Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54935
b: refs/heads/master
c: dc0e6e0
h: refs/heads/master
i:
  54933: ecd7d64
  54931: b5aa0f0
  54927: 62ba6e2
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed May 8, 2007
1 parent f8d3a33 commit 52378e8
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 159 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52102c07a68a26fe6f8926e6a8497b577655f18a
refs/heads/master: dc0e6e0544f1cb2af44e5d7a7e68acda05dec6fa
14 changes: 1 addition & 13 deletions trunk/drivers/video/cfbcopyarea.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
* help moving some redundant computations and branches out of the loop, too.
*/



#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <linux/slab.h>
#include <asm/types.h>
#include <asm/io.h>
#include "fb_draw.h"

#if BITS_PER_LONG == 32
# define FB_WRITEL fb_writel
Expand All @@ -40,17 +39,6 @@
# define FB_READL fb_readq
#endif

/*
* Compose two values, using a bitmask as decision value
* This is equivalent to (a & mask) | (b & ~mask)
*/

static inline unsigned long
comp(unsigned long a, unsigned long b, unsigned long mask)
{
return ((a ^ b) & mask) ^ b;
}

/*
* Generic bitwise copy algorithm
*/
Expand Down
68 changes: 1 addition & 67 deletions trunk/drivers/video/cfbfillrect.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,80 +21,14 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>
#include "fb_draw.h"

#if BITS_PER_LONG == 32
# define FB_WRITEL fb_writel
# define FB_READL fb_readl
#else
# define FB_WRITEL fb_writeq
# define FB_READL fb_readq
#endif

/*
* Compose two values, using a bitmask as decision value
* This is equivalent to (a & mask) | (b & ~mask)
*/

static inline unsigned long
comp(unsigned long a, unsigned long b, unsigned long mask)
{
return ((a ^ b) & mask) ^ b;
}

/*
* Create a pattern with the given pixel's color
*/

#if BITS_PER_LONG == 64
static inline unsigned long
pixel_to_pat( u32 bpp, u32 pixel)
{
switch (bpp) {
case 1:
return 0xfffffffffffffffful*pixel;
case 2:
return 0x5555555555555555ul*pixel;
case 4:
return 0x1111111111111111ul*pixel;
case 8:
return 0x0101010101010101ul*pixel;
case 12:
return 0x0001001001001001ul*pixel;
case 16:
return 0x0001000100010001ul*pixel;
case 24:
return 0x0000000001000001ul*pixel;
case 32:
return 0x0000000100000001ul*pixel;
default:
panic("pixel_to_pat(): unsupported pixelformat\n");
}
}
#else
static inline unsigned long
pixel_to_pat( u32 bpp, u32 pixel)
{
switch (bpp) {
case 1:
return 0xfffffffful*pixel;
case 2:
return 0x55555555ul*pixel;
case 4:
return 0x11111111ul*pixel;
case 8:
return 0x01010101ul*pixel;
case 12:
return 0x00001001ul*pixel;
case 16:
return 0x00010001ul*pixel;
case 24:
return 0x00000001ul*pixel;
case 32:
return 0x00000001ul*pixel;
default:
panic("pixel_to_pat(): unsupported pixelformat\n");
}
}
#endif

/*
Expand Down
72 changes: 72 additions & 0 deletions trunk/drivers/video/fb_draw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#ifndef _FB_DRAW_H
#define _FB_DRAW_H

#include <asm/types.h>

/*
* Compose two values, using a bitmask as decision value
* This is equivalent to (a & mask) | (b & ~mask)
*/

static inline unsigned long
comp(unsigned long a, unsigned long b, unsigned long mask)
{
return ((a ^ b) & mask) ^ b;
}

/*
* Create a pattern with the given pixel's color
*/

#if BITS_PER_LONG == 64
static inline unsigned long
pixel_to_pat( u32 bpp, u32 pixel)
{
switch (bpp) {
case 1:
return 0xfffffffffffffffful*pixel;
case 2:
return 0x5555555555555555ul*pixel;
case 4:
return 0x1111111111111111ul*pixel;
case 8:
return 0x0101010101010101ul*pixel;
case 12:
return 0x0001001001001001ul*pixel;
case 16:
return 0x0001000100010001ul*pixel;
case 24:
return 0x0000000001000001ul*pixel;
case 32:
return 0x0000000100000001ul*pixel;
default:
panic("pixel_to_pat(): unsupported pixelformat\n");
}
}
#else
static inline unsigned long
pixel_to_pat( u32 bpp, u32 pixel)
{
switch (bpp) {
case 1:
return 0xfffffffful*pixel;
case 2:
return 0x55555555ul*pixel;
case 4:
return 0x11111111ul*pixel;
case 8:
return 0x01010101ul*pixel;
case 12:
return 0x00001001ul*pixel;
case 16:
return 0x00010001ul*pixel;
case 24:
return 0x00000001ul*pixel;
case 32:
return 0x00000001ul*pixel;
default:
panic("pixel_to_pat(): unsupported pixelformat\n");
}
}
#endif
#endif /* FB_DRAW_H */
12 changes: 1 addition & 11 deletions trunk/drivers/video/syscopyarea.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,7 @@
#include <linux/slab.h>
#include <asm/types.h>
#include <asm/io.h>

/*
* Compose two values, using a bitmask as decision value
* This is equivalent to (a & mask) | (b & ~mask)
*/

static inline unsigned long
comp(unsigned long a, unsigned long b, unsigned long mask)
{
return ((a ^ b) & mask) ^ b;
}
#include "fb_draw.h"

/*
* Generic bitwise copy algorithm
Expand Down
68 changes: 1 addition & 67 deletions trunk/drivers/video/sysfillrect.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,73 +15,7 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>

/*
* Compose two values, using a bitmask as decision value
* This is equivalent to (a & mask) | (b & ~mask)
*/

static inline unsigned long
comp(unsigned long a, unsigned long b, unsigned long mask)
{
return ((a ^ b) & mask) ^ b;
}

/*
* Create a pattern with the given pixel's color
*/

#if BITS_PER_LONG == 64
static inline unsigned long
pixel_to_pat( u32 bpp, u32 pixel)
{
switch (bpp) {
case 1:
return 0xfffffffffffffffful*pixel;
case 2:
return 0x5555555555555555ul*pixel;
case 4:
return 0x1111111111111111ul*pixel;
case 8:
return 0x0101010101010101ul*pixel;
case 12:
return 0x0001001001001001ul*pixel;
case 16:
return 0x0001000100010001ul*pixel;
case 24:
return 0x0000000001000001ul*pixel;
case 32:
return 0x0000000100000001ul*pixel;
default:
panic("pixel_to_pat(): unsupported pixelformat\n");
}
}
#else
static inline unsigned long
pixel_to_pat( u32 bpp, u32 pixel)
{
switch (bpp) {
case 1:
return 0xfffffffful*pixel;
case 2:
return 0x55555555ul*pixel;
case 4:
return 0x11111111ul*pixel;
case 8:
return 0x01010101ul*pixel;
case 12:
return 0x00001001ul*pixel;
case 16:
return 0x00010001ul*pixel;
case 24:
return 0x00000001ul*pixel;
case 32:
return 0x00000001ul*pixel;
default:
panic("pixel_to_pat(): unsupported pixelformat\n");
}
}
#endif
#include "fb_draw.h"

/*
* Aligned pattern fill using 32/64-bit memory accesses
Expand Down

0 comments on commit 52378e8

Please sign in to comment.