Skip to content

Commit

Permalink
svgalib: move fb_get_caps to svgalib
Browse files Browse the repository at this point in the history
Move fb_get_caps() method to svgalib.c as svga_get_caps() so it can be used by
s3fb, arkfb and vt8623fb.

Signed-off-by: Antonino Daplas <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
adaplas authored and Linus Torvalds committed May 9, 2007
1 parent 681e147 commit 5a87ede
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions drivers/video/arkfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,7 @@ static struct fb_ops arkfb_ops = {
.fb_fillrect = arkfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = arkfb_imageblit,
.fb_get_caps = svga_get_caps,
};


Expand Down
19 changes: 1 addition & 18 deletions drivers/video/s3fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,23 +796,6 @@ static int s3fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
return 0;
}

/* Get capabilities of accelerator based on the mode */

static void s3fb_get_caps(struct fb_info *info, struct fb_blit_caps *caps,
struct fb_var_screeninfo *var)
{
if (var->bits_per_pixel == 0) {
/* can only support 256 8x16 bitmap */
caps->x = 1 << (8 - 1);
caps->y = 1 << (16 - 1);
caps->len = 256;
} else {
caps->x = ~(u32)0;
caps->y = ~(u32)0;
caps->len = ~(u32)0;
}
}

/* ------------------------------------------------------------------------- */

/* Frame buffer operations */
Expand All @@ -829,7 +812,7 @@ static struct fb_ops s3fb_ops = {
.fb_fillrect = s3fb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = s3fb_imageblit,
.fb_get_caps = s3fb_get_caps,
.fb_get_caps = svga_get_caps,
};

/* ------------------------------------------------------------------------- */
Expand Down
17 changes: 17 additions & 0 deletions drivers/video/svgalib.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,23 @@ int svga_get_tilemax(struct fb_info *info)
return 256;
}

/* Get capabilities of accelerator based on the mode */

void svga_get_caps(struct fb_info *info, struct fb_blit_caps *caps,
struct fb_var_screeninfo *var)
{
if (var->bits_per_pixel == 0) {
/* can only support 256 8x16 bitmap */
caps->x = 1 << (8 - 1);
caps->y = 1 << (16 - 1);
caps->len = 256;
} else {
caps->x = (var->bits_per_pixel == 4) ? 1 << (8 - 1) : ~(u32)0;
caps->y = ~(u32)0;
caps->len = ~(u32)0;
}
}
EXPORT_SYMBOL(svga_get_caps);

/* ------------------------------------------------------------------------- */

Expand Down
1 change: 1 addition & 0 deletions drivers/video/vt8623fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ static struct fb_ops vt8623fb_ops = {
.fb_fillrect = vt8623fb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = vt8623fb_imageblit,
.fb_get_caps = svga_get_caps,
};


Expand Down
2 changes: 2 additions & 0 deletions include/linux/svga.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect);
void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit);
void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor);
int svga_get_tilemax(struct fb_info *info);
void svga_get_caps(struct fb_info *info, struct fb_blit_caps *caps,
struct fb_var_screeninfo *var);

int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node);
int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node);
Expand Down

0 comments on commit 5a87ede

Please sign in to comment.