fb: udl: fix build without CONFIG_FB_DEFERRED_IO
Subsystems (3)
PATCH 1/1 fb: udl: fix build without CONFIG_FB_DEFERRED_IO
A cleanup in v4.8 dropped several dependencies, but caused the udl driver to fail building when CONFIG_FB_DEFERRED_IO is not set:
drivers/gpu/drm/udl/udl_fb.c: In function 'udl_fb_open':drivers/gpu/drm/udl/udl_fb.c:206:23: error: 'struct fb_info' has no member named 'fbdefio'
if (fb_defio && (info->fbdefio == NULL)) {
^~This adds an #ifdef check around the code that fails. We know this is safe because it always checks info->fbdefio for being non-NULL, and that member is not defined here.
--- drivers/gpu/drm/udl/udl_fb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/udl/udl_fb.c +8 -1
@@ -24,11 +24,14 @@#define DL_DEFIO_WRITE_DELAY (HZ/20)/* fb_deferred_io.delay in jiffies */ -static int fb_defio =0 ;/* Optionally enable experimental fb_defio mmap support */ static int fb_bpp =16 ;module_param (fb_bpp, int,S_IWUSR |S_IRUSR |S_IWGRP |S_IRGRP ); + +#ifdef CONFIG_FB_DEFERRED_IO +static int fb_defio =0 ;/* Optionally enable experimental fb_defio mmap support */ module_param (fb_defio, int,S_IWUSR |S_IRUSR |S_IWGRP |S_IRGRP ); +#endif struct udl_fbdev {struct drm_fb_helper helper;
@@ -203,6 +206,7 @@ static int udl_fb_open(struct fb_info *info, int user) ufbdev->fb_count++; +#ifdef CONFIG_FB_DEFERRED_IO if (fb_defio && (info->fbdefio ==NULL )) {/* enable defio at last moment if not disabled by client */
@@ -218,6 +222,7 @@ static int udl_fb_open(struct fb_info *info, int user) info->fbdefio = fbdefio; fb_deferred_io_init(info); } +#endif pr_notice ("open /dev/fb%d user=%d fb_info=%p count=%d\n" , info->node, user, info, ufbdev->fb_count);
@@ -235,12 +240,14 @@ static int udl_fb_release(struct fb_info *info, int user) ufbdev->fb_count--; +#ifdef CONFIG_FB_DEFERRED_IO if ((ufbdev->fb_count ==0 ) && (info->fbdefio)) {fb_deferred_io_cleanup (info);kfree (info->fbdefio); info->fbdefio =NULL ; info->fbops->fb_mmap = udl_fb_mmap; } +#endif pr_warn ("released /dev/fb%d user=%d count=%d\n" , info->node, user, ufbdev->fb_count);
Signature · 6 lines
2.9.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Arnd Bergmann
A cleanup in v4.8 dropped several dependencies, but caused the udl driver to fail building when
CONFIG_FB_DEFERRED_IOis not set:
drivers/gpu/drm/udl/udl_fb.c: In function 'udl_fb_open':drivers/gpu/drm/udl/udl_fb.c:206:23: error: 'structfb_info' has no member named 'fbdefio'if (fb_defio && (info->fbdefio == NULL)) { ^~
Quoted 6 lines
This adds an #ifdef check around the code that fails. We know this is safe because it always checks
info->fbdefiofor being non-NULL, and that member is not defined here.Signed-off-by Arnd Bergmann <[email protected]>Fixes c0f0c177b5a9 ("drm/udl: make fbdev support really optional")
There's a pile more needed, which is why I just ended up stuffing them all into linux-next for 4.9. Is your patch still needed on that? If we really want this fixed in 4.8 I guess I can assemble a cherry-pick list.
-Daniel
Quoted 58 lines
--- drivers/gpu/drm/udl/udl_fb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/udl/udl_fb.c +8
-2@@ -24,11 +24,14 @@#define DL_DEFIO_WRITE_DELAY (HZ/20)/* fb_deferred_io.delay in jiffies */ -static int fb_defio =0 ;/* Optionally enable experimental fb_defio mmap support */ static int fb_bpp =16 ;module_param (fb_bpp, int,S_IWUSR |S_IRUSR |S_IWGRP |S_IRGRP ); + +#ifdef CONFIG_FB_DEFERRED_IO +static int fb_defio =0 ;/* Optionally enable experimental fb_defio mmap support */ module_param (fb_defio, int,S_IWUSR |S_IRUSR |S_IWGRP |S_IRGRP ); +#endif struct udl_fbdev {struct drm_fb_helper helper;@@ -203,6 +206,7 @@ static int udl_fb_open(struct fb_info *info, int user) ufbdev->fb_count++; +#ifdef CONFIG_FB_DEFERRED_IO if (fb_defio && (info->fbdefio ==NULL )) {/* enable defio at last moment if not disabled by client */ @@ -218,6 +222,7 @@ static int udl_fb_open(struct fb_info *info, int user) info->fbdefio = fbdefio; fb_deferred_io_init(info); } +#endif pr_notice ("open /dev/fb%d user=%d fb_info=%p count=%d\n" , info->node, user, info, ufbdev->fb_count);@@ -235,12 +240,14 @@ static int udl_fb_release(struct fb_info *info, int user) ufbdev->fb_count--; +#ifdef CONFIG_FB_DEFERRED_IO if ((ufbdev->fb_count ==0 ) && (info->fbdefio)) {fb_deferred_io_cleanup (info);kfree (info->fbdefio); info->fbdefio =NULL ; info->fbops->fb_mmap = udl_fb_mmap; } +#endif pr_warn ("released /dev/fb%d user=%d count=%d\n" , info->node, user, ufbdev->fb_count); --2.9.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 13 lines · CEST Daniel Vetter
Quoted 12 lines · Arnd Bergmann
A cleanup in v4.8 dropped several dependencies, but caused the udl driver to fail building when
CONFIG_FB_DEFERRED_IOis not set:
drivers/gpu/drm/udl/udl_fb.c: In function 'udl_fb_open':drivers/gpu/drm/udl/udl_fb.c:206:23: error: 'structfb_info' has no member named 'fbdefio'if (fb_defio && (info->fbdefio == NULL)) { ^~This adds an #ifdef check around the code that fails. We know this is safe because it always checks
info->fbdefiofor being non-NULL, and that member is not defined here.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes c0f0c177b5a9 ("drm/udl: make fbdev support really optional")There's a pile more needed, which is why I just ended up stuffing them all into linux-next for 4.9. Is your patch still needed on that? If we really want this fixed in 4.8 I guess I can assemble a cherry-pick list.
Ok, got it. I think your 0c756134cf76 ("drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION") is actually sufficient for the build break, it's almost the same as my patch anyway.
Alternatively, reverting c0f0c177b5a9 ("drm/udl: make fbdev support really optional") for v4.8 would work too.
Arnd
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · CEST Daniel Vetter
Quoted 14 lines · Arnd Bergmann
A cleanup in v4.8 dropped several dependencies, but caused the udl driver to fail building when
CONFIG_FB_DEFERRED_IOis not set:
drivers/gpu/drm/udl/udl_fb.c: In function 'udl_fb_open':drivers/gpu/drm/udl/udl_fb.c:206:23: error: 'structfb_info' has no member named 'fbdefio'if (fb_defio && (info->fbdefio == NULL)) { ^~This adds an #ifdef check around the code that fails. We know this is safe because it always checks
info->fbdefiofor being non-NULL, and that member is not defined here.Signed-off-by Arnd Bergmann <[email protected]>Fixes c0f0c177b5a9 ("drm/udl: make fbdev support really optional")
Quoted 8 lines
Quoted 4 lines
There's a pile more needed, which is why I just ended up stuffing them all into linux-next for 4.9. Is your patch still needed on that? If we really want this fixed in 4.8 I guess I can assemble a cherry-pick list.
Ok, got it. I think your
0c756134cf76("drm: Protectfb_defioin drivers withCONFIG_KMS_FBDEV_EMULATION") is actually sufficient for the build break, it's almost the same as my patch anyway.
Dave, can you please cherry-pick that one from -next to -fixes?
Thanks, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel