Thread (5 messages) 5 messages, 3 authors, 2003-01-10

Re: const fb_{fillrect,copyarea,image}?

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2003-01-07 21:32:45

On Tue, 7 Jan 2003, James Simmons wrote:
quoted
Wouldn't it make sense to make the fb_{fillrect,copyarea,image} parameters of
the fb_ops.fb_{fillrect,copyarea,image}() operations const? This would protect
us against side effects when reusing the fb_{fillrect,copyarea,image} structs
without reinitializing their contents (as is currently done by the logo drawing
code in fbcon_show_logo() on SMP).
Where is this exactly?
drivers/video/fbmem.c:fb_show_logo() initializes only image.dx in each loop
iteration:

| for (x = 0; x < num_online_cpus() * (LOGO_W + 8) &&
|      x < info->var.xres - (LOGO_W + 8); x += (LOGO_W + 8)) {
|         image.dx = x;
|         info->fbops->fb_imageblit(info, &image);
|         done = 1;
| }
quoted
Of course this means that we have to modify the clipping code, which currently
just modifies the passed structure.
:-( That is done to prevent someone from passing data that is larger than 
the framebuffer.
You can still do clipping without modifying the passed structure, right?

BTW, is it possible that someone passes data that is larger (except for bugs)?
We have control over what happens in the kernel. Data passed from userspace is
a different issue, of course.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help