All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 21/29] s3fb: use display information in info not in var for panning
@ 2011-05-25 22:58 Laurent Pinchart
  2011-05-26 14:12 ` [PATCH 21/29] s3fb: use display information in info not in var Tormod Volden
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Laurent Pinchart @ 2011-05-25 22:58 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it. Also use the
aligned fix.line_length and not the (possible) unaligned xres_virtual.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Antonino Daplas <adaplas@gmail.com>
---
 drivers/video/savage/savagefb_driver.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index a2dc1a7..6db8485 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -1475,15 +1475,9 @@ static void savagefb_set_par_int(struct savagefb_par  *par, struct savage_reg *r
 	vgaHWProtect(par, 0);
 }
 
-static void savagefb_update_start(struct savagefb_par      *par,
-				  struct fb_var_screeninfo *var)
+static void savagefb_update_start(struct savagefb_par *par, int base)
 {
-	int base;
-
-	base = ((var->yoffset * var->xres_virtual + (var->xoffset & ~1))
-		* ((var->bits_per_pixel+7) / 8)) >> 2;
-
-	/* now program the start address registers */
+	/* program the start address registers */
 	vga_out16(0x3d4, (base & 0x00ff00) | 0x0c, par);
 	vga_out16(0x3d4, ((base & 0x00ff) << 8) | 0x0d, par);
 	vga_out8(0x3d4, 0x69, par);
@@ -1548,8 +1542,12 @@ static int savagefb_pan_display(struct fb_var_screeninfo *var,
 				struct fb_info           *info)
 {
 	struct savagefb_par *par = info->par;
+	int base;
+
+	base = (var->yoffset * info->fix.line_length
+	     + (var->xoffset & ~1) * ((info->var.bits_per_pixel+7) / 8)) >> 2;
 
-	savagefb_update_start(par, var);
+	savagefb_update_start(par, base);
 	return 0;
 }
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 21/29] s3fb: use display information in info not in var
  2011-05-25 22:58 [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
@ 2011-05-26 14:12 ` Tormod Volden
  2011-05-26 16:31 ` [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tormod Volden @ 2011-05-26 14:12 UTC (permalink / raw)
  To: linux-fbdev

On Thu, May 26, 2011 at 12:58 AM, Laurent Pinchart wrote:
> We must not use any information in the passed var besides xoffset,
> yoffset and vmode as otherwise applications might abuse it. Also use the
> aligned fix.line_length and not the (possible) unaligned xres_virtual.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Antonino Daplas <adaplas@gmail.com>
> ---
>  drivers/video/savage/savagefb_driver.c |   16 +++++++---------
>  1 files changed, 7 insertions(+), 9 deletions(-)

The patch title is misleading, this is not the s3fb driver but the
savagefb driver.

Tormod

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 21/29] s3fb: use display information in info not in var for panning
  2011-05-25 22:58 [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
  2011-05-26 14:12 ` [PATCH 21/29] s3fb: use display information in info not in var Tormod Volden
@ 2011-05-26 16:31 ` Laurent Pinchart
  2011-06-03  9:26 ` [PATCH 21/29] s3fb: use display information in info not in var Tormod Volden
  2011-06-06 16:16 ` [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2011-05-26 16:31 UTC (permalink / raw)
  To: linux-fbdev

Hi Tormod,

On Thursday 26 May 2011 16:12:21 Tormod Volden wrote:
> On Thu, May 26, 2011 at 12:58 AM, Laurent Pinchart wrote:
> > We must not use any information in the passed var besides xoffset,
> > yoffset and vmode as otherwise applications might abuse it. Also use the
> > aligned fix.line_length and not the (possible) unaligned xres_virtual.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Antonino Daplas <adaplas@gmail.com>
> > ---
> >  drivers/video/savage/savagefb_driver.c |   16 +++++++---------
> >  1 files changed, 7 insertions(+), 9 deletions(-)
> 
> The patch title is misleading, this is not the s3fb driver but the
> savagefb driver.

Yes, sorry about that. I've fixed the patch title, as well as the next patch.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 21/29] s3fb: use display information in info not in var
  2011-05-25 22:58 [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
  2011-05-26 14:12 ` [PATCH 21/29] s3fb: use display information in info not in var Tormod Volden
  2011-05-26 16:31 ` [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
@ 2011-06-03  9:26 ` Tormod Volden
  2011-06-06 16:16 ` [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
  3 siblings, 0 replies; 5+ messages in thread
From: Tormod Volden @ 2011-06-03  9:26 UTC (permalink / raw)
  To: linux-fbdev

On Thu, May 26, 2011 at 6:31 PM, Laurent Pinchart  wrote:
> On Thursday 26 May 2011 16:12:21 Tormod Volden wrote:
>> On Thu, May 26, 2011 at 12:58 AM, Laurent Pinchart wrote:
>> > We must not use any information in the passed var besides xoffset,
>> > yoffset and vmode as otherwise applications might abuse it. Also use the
>> > aligned fix.line_length and not the (possible) unaligned xres_virtual.
>> >
>> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> > Cc: Antonino Daplas <adaplas@gmail.com>
>> > ---
>> >  drivers/video/savage/savagefb_driver.c |   16 +++++++---------
>> >  1 files changed, 7 insertions(+), 9 deletions(-)
>>
>> The patch title is misleading, this is not the s3fb driver but the
>> savagefb driver.
>
> Yes, sorry about that. I've fixed the patch title, as well as the next patch.

Hi Laurent,
I haven't seen any updated patch posted, but anyway, the patch looks
otherwise correct to me, and I have tested it on my Savage TwisterK:

Reviewed-by: Tormod Volden <debian.tormod@gmail.com>

Cheers,
Tormod

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 21/29] s3fb: use display information in info not in var for panning
  2011-05-25 22:58 [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
                   ` (2 preceding siblings ...)
  2011-06-03  9:26 ` [PATCH 21/29] s3fb: use display information in info not in var Tormod Volden
@ 2011-06-06 16:16 ` Laurent Pinchart
  3 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2011-06-06 16:16 UTC (permalink / raw)
  To: linux-fbdev

Hi Tormod,

On Friday 03 June 2011 11:26:51 Tormod Volden wrote:
> On Thu, May 26, 2011 at 6:31 PM, Laurent Pinchart  wrote:
> > On Thursday 26 May 2011 16:12:21 Tormod Volden wrote:
> >> On Thu, May 26, 2011 at 12:58 AM, Laurent Pinchart wrote:
> >> > We must not use any information in the passed var besides xoffset,
> >> > yoffset and vmode as otherwise applications might abuse it. Also use
> >> > the aligned fix.line_length and not the (possible) unaligned
> >> > xres_virtual.
> >> > 
> >> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >> > Cc: Antonino Daplas <adaplas@gmail.com>
> >> > ---
> >> >  drivers/video/savage/savagefb_driver.c |   16 +++++++---------
> >> >  1 files changed, 7 insertions(+), 9 deletions(-)
> >> 
> >> The patch title is misleading, this is not the s3fb driver but the
> >> savagefb driver.
> > 
> > Yes, sorry about that. I've fixed the patch title, as well as the next
> > patch.
> 
> Hi Laurent,
> I haven't seen any updated patch posted,

That's because I haven't posted the updated patches yet :-) I was waiting for 
more review.

> but anyway, the patch looks otherwise correct to me, and I have tested it on
> my Savage TwisterK:
> 
> Reviewed-by: Tormod Volden <debian.tormod@gmail.com>

Thank you.

It's been a week and a half since I posted the first version, I'll now send an 
updated one with correct titles and Acked-by/Reviewed-by lines.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-06 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-25 22:58 [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
2011-05-26 14:12 ` [PATCH 21/29] s3fb: use display information in info not in var Tormod Volden
2011-05-26 16:31 ` [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart
2011-06-03  9:26 ` [PATCH 21/29] s3fb: use display information in info not in var Tormod Volden
2011-06-06 16:16 ` [PATCH 21/29] s3fb: use display information in info not in var for panning Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.