grub_video_fbrender_target
PATCH 1/1 grub_video_fbrender_target
According to its description, struct grub_video_fbrender_target is a driver-specific structure. video_fb.c is generic code and shouldn't be using this struct to define its function calls, as this makes it impossible to use any of them from outside a driver.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
=== modified file 'include/grub/video_fb.h'
grub/video_fb.h +7 -9
@@ -1,6 +1,6 @@/* * GRUB -- GRand Unified Bootloader -* Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. +* Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -28,8 +28,6 @@struct grub_video_fbblit_info ; -struct grub_video_fbrender_target ; -#define GRUB_VIDEO_FBSTD_NUMCOLORS 16extern struct grub_video_palette_data grub_video_fbstd_colors[GRUB_VIDEO_FBSTD_NUMCOLORS ];
@@ -88,7 +86,7 @@ grub_video_fb_blit_bitmap (struct grub_v unsigned int width, unsigned int height);grub_err_t -grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source, +grub_video_fb_blit_render_target (struct grub_video_render_target *source,enum grub_video_blit_operators oper,int x,int y,int offset_x,int offset_y,unsigned int width,unsigned int height);
@@ -97,22 +95,22 @@ grub_err_t grub_video_fb_scroll (grub_video_color_t color, int dx, int dy);grub_err_t -grub_video_fb_create_render_target (struct grub_video_fbrender_target **result, +grub_video_fb_create_render_target (struct grub_video_render_target **result,unsigned int width,unsigned int height,unsigned int mode_type __attribute__ ((unused)));grub_err_t -grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result, +grub_video_fb_create_render_target_from_pointer (struct grub_video_render_target **result,const struct grub_video_mode_info *mode_info,void *ptr);grub_err_t -grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target); +grub_video_fb_delete_render_target (struct grub_video_render_target *target);grub_err_t -grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target); +grub_video_fb_get_active_render_target (struct grub_video_render_target **target);grub_err_t -grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target); +grub_video_fb_set_active_render_target (struct grub_video_render_target *target);#endif /* ! GRUB_VIDEO_FB_HEADER */
=== modified file 'video/fb/video_fb.c'
fb/video_fb.c +36 -29
154 lines not on this page · raw message
Quoted 6 lines · Robert Millan
According to its description, struct
grub_video_fbrender_targetis a driver-specific structure.video_fb.cis generic code and shouldn't be using this struct to define its function calls, as this makes it impossible to use any of them from outside a driver.
grub_video_render_target is driver-specific but grub_video_fbrender_target isn't. Host driver can either put #define grub_video_render_target grub_video_fbrender_target In which case driver effectively adopts fbrender_target as its render_target or add encapsulators for video_fb functions. I think this patch does more harm than good since if grub_video_render_target isn't grub_video_fbrender_target then compiler won't complain.
Quoted 6 lines
------------------------------------------------------------------------
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 7 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 6 lines · Robert Millan
According to its description, struct
grub_video_fbrender_targetis a driver-specific structure.video_fb.cis generic code and shouldn't be using this struct to define its function calls, as this makes it impossible to use any of them from outside a driver.
Quoted 7 lines
grub_video_render_targetis driver-specific butgrub_video_fbrender_targetisn't. Host driver can either put #definegrub_video_render_targetgrub_video_fbrender_targetIn which case driver effectively adoptsfbrender_targetas itsrender_targetor add encapsulators forvideo_fbfunctions. I think this patch does more harm than good since ifgrub_video_render_targetisn'tgrub_video_fbrender_targetthen compiler won't complain.
Ah, I see what you mean. This is unfortunate, as drivers can't be offloaded from the obligation to define generic handlers just to assert that they use the same struct definition.
I was trying to simplify driver registration by making it optional to define operations, making the fallback to generic code automatic.
But well, it's not so important.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."