From: Krzysztof H. <krz...@po...> - 2009-07-09 18:09:21
|
On Thu, 09 Jul 2009 17:09:00 +0200 Pawel Osciak <p.o...@sa...> wrote: > Added support for panning the display in all directions. > > > Reviewed-by: Marek Szyprowski <m.s...@sa...> > Reviewed-by: Kyungmin Park <kyu...@sa...> > Signed-off-by: Pawel Osciak <p.o...@sa...> > > > > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > index ff0b1a3..77b77a2 100644 > --- a/drivers/video/s3c-fb.c > +++ b/drivers/video/s3c-fb.c > @@ -294,6 +294,8 @@ static int s3c_fb_set_par(struct fb_info *info) > } > > info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8; > + info->fix.xpanstep = info->var.xres_virtual > info->var.xres ? 1 : 0; > + info->fix.ypanstep = info->var.yres_virtual > info->var.yres ? 1 : 0; > These two lines are not need. If the xres_virtual > xres there is no panning possible (the same is true for yres and yres_virtual). > /* disable the window whilst we update it */ > writel(0, regs + WINCON(win_no)); > @@ -640,6 +642,38 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) > return 0; > } > > +/** > + * s3c_fb_pan_display() - Pan the display. > + * > + * Note, that the offsets can be written to the device at any time, as their > + * values are latched at each vsync automatically. This also means that only > + * the last call to this function will have any effect on next vsync, but > + * there is no need to sleep waiting for it to prevent tearing. > + * > + * @var: The screen information to verify. > + * @info: The framebuffer device. > + */ > +static int s3c_fb_pan_display(struct fb_var_screeninfo *var, > + struct fb_info *info) > +{ > + struct s3c_fb_win *win = info->par; > + struct s3c_fb *sfb = win->parent; > + unsigned int start_byte_offset, end_byte_offset; > + > + /* Offset in bytes to the start of the displayed area */ > + start_byte_offset = var->yoffset * info->fix.line_length > + + var->xoffset * (info->var.bits_per_pixel) / 8; > + writel(info->fix.smem_start + start_byte_offset, > + sfb->regs + VIDW_BUF_START(win->index)); > + Check out carefully what units are used for VIDW_BUF_START (pixels, bytes, words, dwords). This x panning may not work on all depths supported by the driver (18-bit, 19-bit, 1-bit, etc). Do you really want panning in the x direction? Please test it in all depths. Regards, Krzysztof ---------------------------------------------------------------------- Rowerem do pracy? Czemu nie! Kliknij >>> http://link.interia.pl/f2256 |
From: Pawel O. <p.o...@sa...> - 2009-07-07 10:55:11
|
Added support for panning the display in all directions. Reviewed-by: Marek Szyprowski <m.s...@sa...> Reviewed-by: Kyungmin Park <kyu...@sa...> Signed-off-by: Pawel Osciak <p.o...@sa...> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index ff0b1a3..77b77a2 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -294,6 +294,8 @@ static int s3c_fb_set_par(struct fb_info *info) } info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8; + info->fix.xpanstep = info->var.xres_virtual > info->var.xres ? 1 : 0; + info->fix.ypanstep = info->var.yres_virtual > info->var.yres ? 1 : 0; /* disable the window whilst we update it */ writel(0, regs + WINCON(win_no)); @@ -640,6 +642,38 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) return 0; } +/** + * s3c_fb_pan_display() - Pan the display. + * + * Note, that the offsets can be written to the device at any time, as their + * values are latched at each vsync automatically. This also means that only + * the last call to this function will have any effect on next vsync, but + * there is no need to sleep waiting for it to prevent tearing. + * + * @var: The screen information to verify. + * @info: The framebuffer device. + */ +static int s3c_fb_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + struct s3c_fb_win *win = info->par; + struct s3c_fb *sfb = win->parent; + unsigned int start_byte_offset, end_byte_offset; + + /* Offset in bytes to the start of the displayed area */ + start_byte_offset = var->yoffset * info->fix.line_length + + var->xoffset * (info->var.bits_per_pixel) / 8; + writel(info->fix.smem_start + start_byte_offset, + sfb->regs + VIDW_BUF_START(win->index)); + + /* Offset in bytes to the end of the displayed area */ + end_byte_offset = start_byte_offset + var->yres * info->fix.line_length; + writel(info->fix.smem_start + end_byte_offset, + sfb->regs + VIDW_BUF_END(win->index)); + + return 0; +} + static struct fb_ops s3c_fb_ops = { .owner = THIS_MODULE, .fb_check_var = s3c_fb_check_var, @@ -649,6 +683,7 @@ static struct fb_ops s3c_fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, + .fb_pan_display = s3c_fb_pan_display, }; /** |
From: Pawel O. <p.o...@sa...> - 2009-07-09 15:39:30
|
Added support for panning the display in all directions. Reviewed-by: Marek Szyprowski <m.s...@sa...> Reviewed-by: Kyungmin Park <kyu...@sa...> Signed-off-by: Pawel Osciak <p.o...@sa...> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index ff0b1a3..77b77a2 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -294,6 +294,8 @@ static int s3c_fb_set_par(struct fb_info *info) } info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8; + info->fix.xpanstep = info->var.xres_virtual > info->var.xres ? 1 : 0; + info->fix.ypanstep = info->var.yres_virtual > info->var.yres ? 1 : 0; /* disable the window whilst we update it */ writel(0, regs + WINCON(win_no)); @@ -640,6 +642,38 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info) return 0; } +/** + * s3c_fb_pan_display() - Pan the display. + * + * Note, that the offsets can be written to the device at any time, as their + * values are latched at each vsync automatically. This also means that only + * the last call to this function will have any effect on next vsync, but + * there is no need to sleep waiting for it to prevent tearing. + * + * @var: The screen information to verify. + * @info: The framebuffer device. + */ +static int s3c_fb_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + struct s3c_fb_win *win = info->par; + struct s3c_fb *sfb = win->parent; + unsigned int start_byte_offset, end_byte_offset; + + /* Offset in bytes to the start of the displayed area */ + start_byte_offset = var->yoffset * info->fix.line_length + + var->xoffset * (info->var.bits_per_pixel) / 8; + writel(info->fix.smem_start + start_byte_offset, + sfb->regs + VIDW_BUF_START(win->index)); + + /* Offset in bytes to the end of the displayed area */ + end_byte_offset = start_byte_offset + var->yres * info->fix.line_length; + writel(info->fix.smem_start + end_byte_offset, + sfb->regs + VIDW_BUF_END(win->index)); + + return 0; +} + static struct fb_ops s3c_fb_ops = { .owner = THIS_MODULE, .fb_check_var = s3c_fb_check_var, @@ -649,6 +683,7 @@ static struct fb_ops s3c_fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, + .fb_pan_display = s3c_fb_pan_display, }; /** |
From: Russell K. - A. L. <li...@ar...> - 2009-07-09 18:19:55
|
On Thu, Jul 09, 2009 at 07:49:12PM +0200, Krzysztof Helt wrote: > On Thu, 09 Jul 2009 17:09:00 +0200 > Pawel Osciak <p.o...@sa...> wrote: > > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > > index ff0b1a3..77b77a2 100644 > > --- a/drivers/video/s3c-fb.c > > +++ b/drivers/video/s3c-fb.c > > @@ -294,6 +294,8 @@ static int s3c_fb_set_par(struct fb_info *info) > > } > > > > info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8; > > + info->fix.xpanstep = info->var.xres_virtual > info->var.xres ? 1 : 0; > > + info->fix.ypanstep = info->var.yres_virtual > info->var.yres ? 1 : 0; > > > > These two lines are not need. If the xres_virtual > xres there is no > panning possible (the same is true for yres and yres_virtual). Erm, I think you have that backwards. xres,yres is the visibly displayed dimentions. xres_virtual,yres_virtual is the size of the underlying framebuffer. If the underlying framebuffer is larger than the visible display, you can pan the visible display around within the underlying framebuffer. It is common for unaccelerated framebuffers used in text mode to have xres_virtual = xres, yres_virtual >> yres so that Y panning (or if your video driver supports it, wrapping) can occur to speed line scrolling. |
From: Krzysztof H. <krz...@po...> - 2009-07-10 14:34:26
|
On Thu, 9 Jul 2009 19:02:28 +0100 Russell King - ARM Linux <li...@ar...> wrote: > On Thu, Jul 09, 2009 at 07:49:12PM +0200, Krzysztof Helt wrote: > > On Thu, 09 Jul 2009 17:09:00 +0200 > > Pawel Osciak <p.o...@sa...> wrote: > > > diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c > > > index ff0b1a3..77b77a2 100644 > > > --- a/drivers/video/s3c-fb.c > > > +++ b/drivers/video/s3c-fb.c > > > @@ -294,6 +294,8 @@ static int s3c_fb_set_par(struct fb_info *info) > > > } > > > > > > info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8; > > > + info->fix.xpanstep = info->var.xres_virtual > info->var.xres ? 1 : 0; > > > + info->fix.ypanstep = info->var.yres_virtual > info->var.yres ? 1 : 0; > > > > > > > These two lines are not need. If the xres_virtual > xres there is no > > panning possible (the same is true for yres and yres_virtual). > > Erm, I think you have that backwards. > Right. The given conditions (xres_virtual < xres) are already checked by a higher layer so there is no need for this condition here. > xres,yres is the visibly displayed dimentions. > xres_virtual,yres_virtual is the size of the underlying framebuffer. > > If the underlying framebuffer is larger than the visible display, you can > pan the visible display around within the underlying framebuffer. > > It is common for unaccelerated framebuffers used in text mode to have > xres_virtual = xres, yres_virtual >> yres so that Y panning (or if your > video driver supports it, wrapping) can occur to speed line scrolling. > You are right, of course. Regards, Krzysztof ---------------------------------------------------------------------- Ubezpieczenie komunikacyjne wraz z ubezpieczeniem kosztow leczenia za granic±. http://link.interia.pl/f222b |