Skip to contentSkip to conversation

drm/rockchip: rgb: add stub functions when rgb encoder is disabled

PATCH In review Heiko Stuebner 2 participants 3 messages Sep 5, 2018

Subsystems (4)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

PATCH 1/1 drm/rockchip: rgb: add stub functions when rgb encoder is disabled

The newly added internal rgb encoder for Rockchip vops is missing stubs for the case that the rgb output part is not enabled in the kernel config. So add these.

Fixes 1f0f01515172 ("drm/rockchip: Add support for Rockchip Soc RGB output interface")
---
 drivers/gpu/drm/rockchip/rockchip_rgb.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/rockchip/rockchip_rgb.h +14 -0
index c712a673d1e3..bcd903688491 100644
@@ -14,7 +14,21 @@
  * GNU General Public License for more details.
  */
 
+#ifdef CONFIG_ROCKCHIP_RGB
 struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
 				       struct drm_crtc *crtc,
 				       struct drm_device *drm_dev);
 void rockchip_rgb_fini(struct rockchip_rgb *rgb);
+#else
+static inline struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
+				       struct drm_crtc *crtc,
+				       struct drm_device *drm_dev)
+{
+	return NULL;
+}
+
+static inline void rockchip_rgb_fini(struct rockchip_rgb *rgb)
+{
+	return;
+}
+#endif
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Heiko Stuebner

The newly added internal rgb encoder for Rockchip vops is missing stubs for the case that the rgb output part is not enabled in the kernel config. So add these.

Fixes 1f0f01515172 ("drm/rockchip: Add support for Rockchip Soc RGB output interface")
---
 drivers/gpu/drm/rockchip/rockchip_rgb.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/rockchip/rockchip_rgb.h +2 -0
index c712a673d1e3..bcd903688491 100644
@@ -14,7 +14,21 @@
  * GNU General Public License for more details.
  */
 
+#ifdef CONFIG_ROCKCHIP_RGB
 struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
 				       struct drm_crtc *crtc,
 				       struct drm_device *drm_dev);
 void rockchip_rgb_fini(struct rockchip_rgb *rgb);
+#else

drivers/gpu/drm/rockchip/rockchip_rgb.h line 32

Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_rgb.h +10 -0
+static inline struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
+				       struct drm_crtc *crtc,
+				       struct drm_device *drm_dev)
+{
+	return NULL;
+}
+
+static inline void rockchip_rgb_fini(struct rockchip_rgb *rgb)
+{
+	return;

This return is redundant. With that nit fixed, feel free to commit with

Quoted 9 lines
drivers/gpu/drm/rockchip/rockchip_rgb.h +2 -0
+}
+#endif
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 38 lines · Sean Paul
Quoted 24 lines · Heiko Stuebner

The newly added internal rgb encoder for Rockchip vops is missing stubs for the case that the rgb output part is not enabled in the kernel config. So add these.

Fixes 1f0f01515172 ("drm/rockchip: Add support for Rockchip Soc RGB output interface")
---
 drivers/gpu/drm/rockchip/rockchip_rgb.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/rockchip/rockchip_rgb.h +2 -0
index c712a673d1e3..bcd903688491 100644
@@ -14,7 +14,21 @@
  * GNU General Public License for more details.
  */
 
+#ifdef CONFIG_ROCKCHIP_RGB
 struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
 				       struct drm_crtc *crtc,
 				       struct drm_device *drm_dev);
 void rockchip_rgb_fini(struct rockchip_rgb *rgb);
+#else

drivers/gpu/drm/rockchip/rockchip_rgb.h line 32

Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_rgb.h +10 -0
+static inline struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
+				       struct drm_crtc *crtc,
+				       struct drm_device *drm_dev)
+{
+	return NULL;
+}
+
+static inline void rockchip_rgb_fini(struct rockchip_rgb *rgb)
+{
+	return;

This return is redundant. With that nit fixed, feel free to commit with

Quoted 1 line

I went ahead and applied this myself since I'm prepping a pull request.

Thanks for the quick fix.

Sean

Quoted 14 lines
Quoted 11 lines
drivers/gpu/drm/rockchip/rockchip_rgb.h +2 -0
+}
+#endif
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel