Skip to contentSkip to conversation

drm/fb-helper: Build fixes for cleanup

PATCH In review Thomas Zimmermann 1 participant 5 messages Nov 7, 2022 – Nov 8, 2022

Subsystems (3)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover drm/fb-helper: Build fixes for cleanup

Cleaning up the fbdev code produced a number of simple build errors. Fix them.

Thomas Zimmermann (3):
drm/fbdev: Include <linux/vmalloc.h> drm/hisilicon/hibmc: Include <linux/io.h> for readl() and writel() drm/fb-helper: Document struct drm_fb_helper.hint_leak_smem_start

 drivers/gpu/drm/drm_fbdev_generic.c              | 1 +
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 2 ++
 include/drm/drm_fb_helper.h                      | 7 +++++++
 3 files changed, 10 insertions(+)
Signature · 1 line
2.38.0
author maintainer
#1 lore raw

PATCH 1/3 drm/fbdev: Include <linux/vmalloc.h>

Include <linux/vmalloc.h> in fbdev emulation to get vzalloc() and vfree() on MIPS. The error messages are shown below and bug reports are at [1] and [2].

drivers/gpu/drm/drm_fbdev_generic.c: In function 'drm_fbdev_cleanup':
drivers/gpu/drm/drm_fbdev_generic.c:63:17: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]

     63 |                 vfree(shadow);
        |                 ^~~~~
        |                 kvfree
  drivers/gpu/drm/drm_fbdev_generic.c: In function 'drm_fbdev_fb_probe':
  drivers/gpu/drm/drm_fbdev_generic.c:219:38: error: implicit declaration of function 'vzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
    219 |                 fbi->screen_buffer = vzalloc(fbi->screen_size);
        |                                      ^~~~~~~
        |                                      kvzalloc
  drivers/gpu/drm/drm_fbdev_generic.c:219:36: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    219 |                 fbi->screen_buffer = vzalloc(fbi->screen_size);
Fixes 8ab59da26bc0 ("drm/fb-helper: Move generic fbdev emulation into separate source file")
Cc Thomas Zimmermann <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_fbdev_generic.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_fbdev_generic.c +1 -0
index 2d6083ad2e3c7..ab86956692795 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: MIT
 
 #include <linux/moduleparam.h>
+#include <linux/vmalloc.h>
 
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_drv.h>
Signature · 1 line
2.38.0
author maintainer
#2 lore raw

PATCH 2/3 drm/hisilicon/hibmc: Include <linux/io.h> for readl() and writel()

In reply to Thomas Zimmermann

Include <linux/io.h> to get readl() and writel() on S390. The error message is shown below and a bug report is at [1].

drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c:75:15: error: implicit declaration of function 'readl' [-Werror=implicit-function-declaration]

     75 |         reg = readl(priv->mmio + HIBMC_DISPLAY_CONTROL_HISILE);
        |               ^~~~~
  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c:80:9: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration]
     80 |         writel(reg, priv->mmio + HIBMC_DISPLAY_CONTROL_HISILE);
	|         ^~~~~~
Fixes 45b64fd9f7ae ("drm/fb-helper: Remove unnecessary include statements")
Cc Thomas Zimmermann <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +2 -0
index c228091fb0e6a..8c6d2ea2a4729 100644
@@ -11,6 +11,8 @@
  *	Jianhua Li <[email protected]>
  */
 
+#include <linux/io.h>
+
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_print.h>
Signature · 1 line
2.38.0
author maintainer
#3 lore raw

PATCH 3/3 drm/fb-helper: Document struct drm_fb_helper.hint_leak_smem_start

In reply to Thomas Zimmermann

Document the new field smem_start in struct drm_fb_helper and avoid a compile-time warning. An error message is shown below and the bug report is at [1].

include/drm/drm_fb_helper.h:204: warning: Function parameter or member 'hint_leak_smem_start' not described in 'drm_fb_helper'

Fixes e7c5c29a9eb1 ("drm/fb-helper: Set flag in struct drm_fb_helper for leaking physical addresses")
Cc Thomas Zimmermann <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 include/drm/drm_fb_helper.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/drm/drm_fb_helper.h +7 -0
index ecfcd2c56d95a..b111dc7ada78d 100644
@@ -200,6 +200,13 @@ struct drm_fb_helper {
 	 */
 	int preferred_bpp;
 
+	/**
+	 * @hint_leak_smem_start:
+	 *
+	 * Hint to the fbdev emulation to store the framebuffer's physical
+	 * address in struct &fb_info.fix.smem_start. If the hint is unset,
+	 * the smem_start field should always be cleared to zero.
+	 */
 	bool hint_leak_smem_start;
 };
 
Signature · 1 line
2.38.0
author maintainer
#4 lore raw
In reply to Thomas Zimmermann

a-b: danvet via irc

Am 07.11.22 um 13:53 schrieb Thomas Zimmermann:

Quoted 13 lines

Cleaning up the fbdev code produced a number of simple build errors. Fix them.

Thomas Zimmermann (3):
drm/fbdev: Include <linux/vmalloc.h> drm/hisilicon/hibmc: Include <linux/io.h> for readl() and writel() drm/fb-helper: Document struct drm_fb_helper.hint_leak_smem_start

  drivers/gpu/drm/drm_fbdev_generic.c              | 1 +
  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 2 ++
  include/drm/drm_fb_helper.h                      | 7 +++++++
  3 files changed, 10 insertions(+)
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev