Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread James Simmons
> > No, bits_per_pixel can be (much) larger than the color map size. E.g. a > > simple > > ARGB directcolor mode has bits_per_pixel = 32 and color map size = 256. > > So I have the bits_per_pixel attribute wrong in sysfs. It needs to be > bits_per_color and then let the driver sort it out.

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread James Simmons
> > 3) Add another file in sysfs which specifies at what index and how many > > entries will be read or written from or to the cmap. With this additional > > sysfs file, it should be able to handle any reasonable cmap length, but > > it will take more than one reading of the color_map file.

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread Jon Smirl
On 7/29/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > On Fri, 29 Jul 2005, Antonino A. Daplas wrote: > > Jon Smirl wrote: > > > On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > > > On Thu, 28 Jul 2005, Jon Smirl wrote: > > > > > I've verified now that all ATI R300+ chips have

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread Geert Uytterhoeven
On Fri, 29 Jul 2005, Antonino A. Daplas wrote: > Jon Smirl wrote: > > On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > > On Thu, 28 Jul 2005, Jon Smirl wrote: > > > > I've verified now that all ATI R300+ chips have 10bit cmaps. These are > > > > pretty common so I'd be in favor of

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread Geert Uytterhoeven
On Fri, 29 Jul 2005, Antonino A. Daplas wrote: Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Thu, 28 Jul 2005, Jon Smirl wrote: I've verified now that all ATI R300+ chips have 10bit cmaps. These are pretty common so I'd be in favor of making this into a

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread Jon Smirl
On 7/29/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Fri, 29 Jul 2005, Antonino A. Daplas wrote: Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Thu, 28 Jul 2005, Jon Smirl wrote: I've verified now that all ATI R300+ chips have 10bit cmaps. These

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread James Simmons
3) Add another file in sysfs which specifies at what index and how many entries will be read or written from or to the cmap. With this additional sysfs file, it should be able to handle any reasonable cmap length, but it will take more than one reading of the color_map file. Another

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-29 Thread James Simmons
No, bits_per_pixel can be (much) larger than the color map size. E.g. a simple ARGB directcolor mode has bits_per_pixel = 32 and color map size = 256. So I have the bits_per_pixel attribute wrong in sysfs. It needs to be bits_per_color and then let the driver sort it out.

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Geert Uytterhoeven wrote: On Thu, 28 Jul 2005, Antonino A. Daplas wrote: Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: There are a couple of ways to fix this. 1) Add a check to limit use of the sysfs

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: On Thu, 28 Jul 2005, Jon Smirl wrote: I've verified now that all ATI R300+ chips have 10bit cmaps. These are pretty common so I'd be in favor of making this into a binary attribute where I can get/set the whole table at

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Jon Smirl wrote: Can you review this fix for the issues below? I fixed things to automatically adjust the number of entries to whatever fits in PAGE_SIZE. diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c @@ -244,15

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > On Thu, 28 Jul 2005, Jon Smirl wrote: > > I've verified now that all ATI R300+ chips have 10bit cmaps. These are > > pretty common so I'd be in favor of making this into a binary > > attribute where I can get/set the whole table at once.

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: > I've verified now that all ATI R300+ chips have 10bit cmaps. These are > pretty common so I'd be in favor of making this into a binary > attribute where I can get/set the whole table at once. Given that > OpenGL is already supporting 12 and 16 bits these

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > On Thu, 28 Jul 2005, Jon Smirl wrote: > > I can't see a way to query how long of cmap the device supports using > > the current fbdev ioctls. > > Look at the lengths of the color bitfields? Which color bitfields? Does hardware that

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
I've verified now that all ATI R300+ chips have 10bit cmaps. These are pretty common so I'd be in favor of making this into a binary attribute where I can get/set the whole table at once. Given that OpenGL is already supporting 12 and 16 bits these tables are only going to get much larger. 1024

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Jon Smirl <[EMAIL PROTECTED]> wrote: > On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > On Thu, 28 Jul 2005, Jon Smirl wrote: > > > I can't see a way to query how long of cmap the device supports using > > > the current fbdev ioctls. > > > > Look at the lengths of the

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: > I can't see a way to query how long of cmap the device supports using > the current fbdev ioctls. Look at the lengths of the color bitfields? > I wouldn't even be messing with cmap except for the true/direct color > support and gamma ramps. Don't I need to

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: > Do we want to apply this patch now to get rid of the buffer overflow hole? IMHO, yes please. > Then we can take our time and work out a better solution. Indeed. > Fix a buffer overflow vunerabilty in previous cmap patch > signed-off-by: Jon Smirl <[EMAIL

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
Do we want to apply this patch now to get rid of the buffer overflow hole? Then we can take our time and work out a better solution. -- Jon Smirl [EMAIL PROTECTED] Fix a buffer overflow vunerabilty in previous cmap patch signed-off-by: Jon Smirl <[EMAIL PROTECTED]> diff --git

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
I can't see a way to query how long of cmap the device supports using the current fbdev ioctls. I wouldn't even be messing with cmap except for the true/direct color support and gamma ramps. Don't I need to know how long the cmap is in order to set the right gamma ramp? If I set a 256 entry

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > On Thu, 28 Jul 2005, Antonino A. Daplas wrote: > > Jon Smirl wrote: > > > On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > > > On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: > > > > > > There are a couple of ways to

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: > Can you review this fix for the issues below? I fixed things to > automatically adjust the number of entries to whatever fits in > PAGE_SIZE. Looks OK, but... > @@ -317,18 +317,18 @@ static ssize_t show_cmap(struct class_de > !fb_info->cmap.green)

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Antonino A. Daplas wrote: > Jon Smirl wrote: > > On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > > On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: > > > > There are a couple of ways to fix this. > > 1) Add a check to limit use of the sysfs attributes to

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: There are a couple of ways to fix this. 1) Add a check to limit use of the sysfs attributes to 256 entries. If you want more you have to use /dev/fb0 and the

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
gt; On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: > > tree 17014af0ea8b19dae7848736d324499715b7a1a3 > > parent 3ca34fcbfbf8a7cbe99d54ae81c4e28fdc6f4ac6 > > author Jon Smirl <[EMAIL PROTECTED]> Thu, 28 Jul 2005 01:46:05 -0700 > > committer Linus Torvalds <[EMAIL PROTECTED]&g

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: > On 7/28/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: > > There are a couple of ways to fix this. > > 1) Add a check to limit use of the sysfs attributes to 256 entries. If > you want more you

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
orvalds <[EMAIL PROTECTED]> Thu, 28 Jul 2005 06:26:18 -0700 > > > > [PATCH] fbdev: colormap fixes > > > > Color maps have up to 256 entries. 4096/256 allows for 16 characters per > ^^ > Most (all?) current drivers have this limitati

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
hu, 28 Jul 2005 06:26:18 -0700 > > [PATCH] fbdev: colormap fixes > > Color maps have up to 256 entries. 4096/256 allows for 16 characters per ^^ Most (all?) current drivers have this limitation. But there exists hardware with more entries. > line. Th

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
[PATCH] fbdev: colormap fixes Color maps have up to 256 entries. 4096/256 allows for 16 characters per ^^ Most (all?) current drivers have this limitation. But there exists hardware with more entries. line. The format for a cmap entry is %02x%c%4x%4x%4x\n %02x

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
-0700 [PATCH] fbdev: colormap fixes Color maps have up to 256 entries. 4096/256 allows for 16 characters per ^^ Most (all?) current drivers have this limitation. But there exists hardware with more entries. line. The format for a cmap entry is %02x%c%4x

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: There are a couple of ways to fix this. 1) Add a check to limit use of the sysfs attributes to 256 entries. If you want more you have to

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
PROTECTED] Thu, 28 Jul 2005 01:46:05 -0700 committer Linus Torvalds [EMAIL PROTECTED] Thu, 28 Jul 2005 06:26:18 -0700 [PATCH] fbdev: colormap fixes Color maps have up to 256 entries. 4096/256 allows for 16 characters per ^^ Most (all?) current drivers have

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: There are a couple of ways to fix this. 1) Add a check to limit use of the sysfs attributes to 256 entries. If you want more you have to use /dev/fb0 and the

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Antonino A. Daplas wrote: Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: There are a couple of ways to fix this. 1) Add a check to limit use of the sysfs attributes to 256 entries. If

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: Can you review this fix for the issues below? I fixed things to automatically adjust the number of entries to whatever fits in PAGE_SIZE. Looks OK, but... @@ -317,18 +317,18 @@ static ssize_t show_cmap(struct class_de !fb_info-cmap.green)

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Thu, 28 Jul 2005, Antonino A. Daplas wrote: Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: There are a couple of ways to fix this. 1) Add a

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
I can't see a way to query how long of cmap the device supports using the current fbdev ioctls. I wouldn't even be messing with cmap except for the true/direct color support and gamma ramps. Don't I need to know how long the cmap is in order to set the right gamma ramp? If I set a 256 entry

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
Do we want to apply this patch now to get rid of the buffer overflow hole? Then we can take our time and work out a better solution. -- Jon Smirl [EMAIL PROTECTED] Fix a buffer overflow vunerabilty in previous cmap patch signed-off-by: Jon Smirl [EMAIL PROTECTED] diff --git

Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: Do we want to apply this patch now to get rid of the buffer overflow hole? IMHO, yes please. Then we can take our time and work out a better solution. Indeed. Fix a buffer overflow vunerabilty in previous cmap patch signed-off-by: Jon Smirl [EMAIL

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: I can't see a way to query how long of cmap the device supports using the current fbdev ioctls. Look at the lengths of the color bitfields? I wouldn't even be messing with cmap except for the true/direct color support and gamma ramps. Don't I need to

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Jon Smirl [EMAIL PROTECTED] wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Thu, 28 Jul 2005, Jon Smirl wrote: I can't see a way to query how long of cmap the device supports using the current fbdev ioctls. Look at the lengths of the color bitfields?

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
I've verified now that all ATI R300+ chips have 10bit cmaps. These are pretty common so I'd be in favor of making this into a binary attribute where I can get/set the whole table at once. Given that OpenGL is already supporting 12 and 16 bits these tables are only going to get much larger. 1024

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Thu, 28 Jul 2005, Jon Smirl wrote: I can't see a way to query how long of cmap the device supports using the current fbdev ioctls. Look at the lengths of the color bitfields? Which color bitfields? Does hardware that supports

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Geert Uytterhoeven
On Thu, 28 Jul 2005, Jon Smirl wrote: I've verified now that all ATI R300+ chips have 10bit cmaps. These are pretty common so I'd be in favor of making this into a binary attribute where I can get/set the whole table at once. Given that OpenGL is already supporting 12 and 16 bits these tables

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Jon Smirl
On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Thu, 28 Jul 2005, Jon Smirl wrote: I've verified now that all ATI R300+ chips have 10bit cmaps. These are pretty common so I'd be in favor of making this into a binary attribute where I can get/set the whole table at once. Given

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Jon Smirl wrote: Can you review this fix for the issues below? I fixed things to automatically adjust the number of entries to whatever fits in PAGE_SIZE. diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c @@ -244,15

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Thu, 28 Jul 2005, Jon Smirl wrote: I've verified now that all ATI R300+ chips have 10bit cmaps. These are pretty common so I'd be in favor of making this into a binary attribute where I can get/set the whole table at

Re: [Linux-fbdev-devel] Re: [PATCH] fbdev: colormap fixes

2005-07-28 Thread Antonino A. Daplas
Geert Uytterhoeven wrote: On Thu, 28 Jul 2005, Antonino A. Daplas wrote: Jon Smirl wrote: On 7/28/05, Geert Uytterhoeven [EMAIL PROTECTED] wrote: On Wed, 27 Jul 2005, Linux Kernel Mailing List wrote: There are a couple of ways to fix this. 1) Add a check to limit use of the sysfs attributes