Skip to contentSkip to conversation

drm/lcdif: Clean up headers

PATCH Superseded Marek Vasut 3 participants 6 messages Jul 9, 2022

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Marek Vasut

author maintainer
#0 lore raw

PATCH v2 1/4 drm/lcdif: Clean up headers

Drop unneeded headers, sort rest alphabetically, no functional change.

Fixes 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Cc Alexander Stein <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Liu Ying <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Martyn Welch <[email protected]>
Cc Peng Fan <[email protected]>
Cc Robby Cai <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stefan Agner <[email protected]>

---
V2: Add RB from Liu

---
 drivers/gpu/drm/mxsfb/lcdif_drv.c | 3 ---
 drivers/gpu/drm/mxsfb/lcdif_drv.h | 1 +
 drivers/gpu/drm/mxsfb/lcdif_kms.c | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/mxsfb/lcdif_drv.c +0 -3
index befad33dcb959..1370889c6d687 100644
@@ -8,7 +8,6 @@
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
 #include <linux/io.h>
-#include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -16,10 +15,8 @@
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
-#include <drm/drm_connector.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fb_helper.h>
-#include <drm/drm_fourcc.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_mode_config.h>
drivers/gpu/drm/mxsfb/lcdif_drv.h +1 -0
index cb916341e8454..6cdba6e20c02b 100644
@@ -8,6 +8,7 @@
 #ifndef __LCDIF_DRV_H__
 #define __LCDIF_DRV_H__
 
+#include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
 #include <drm/drm_encoder.h>
drivers/gpu/drm/mxsfb/lcdif_kms.c +1 -1
index 1bec1279c8b56..d7363e2b2fad0 100644
@@ -17,9 +17,9 @@
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_encoder.h>
-#include <drm/drm_framebuffer.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_fourcc.h>
+#include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_plane.h>
Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH v2 2/4 drm/lcdif: Consistently use plane timings

Drop the crtc_ prefix from mode, consistently use the plain one.

Fixes 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Cc Alexander Stein <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Liu Ying <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Martyn Welch <[email protected]>
Cc Peng Fan <[email protected]>
Cc Robby Cai <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stefan Agner <[email protected]>

---
V2: Add RB from Liu
Replace plane with plain

---
 drivers/gpu/drm/mxsfb/lcdif_kms.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/mxsfb/lcdif_kms.c +4 -4
index d7363e2b2fad0..829b0a6bb0d3f 100644
@@ -123,8 +123,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags)
 
 	writel(ctrl, lcdif->base + LCDC_V8_CTRL);
 
-	writel(DISP_SIZE_DELTA_Y(m->crtc_vdisplay) |
-	       DISP_SIZE_DELTA_X(m->crtc_hdisplay),
+	writel(DISP_SIZE_DELTA_Y(m->vdisplay) |
+	       DISP_SIZE_DELTA_X(m->hdisplay),
 	       lcdif->base + LCDC_V8_DISP_SIZE);
 
 	writel(HSYN_PARA_BP_H(m->htotal - m->hsync_end) |
@@ -139,8 +139,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags)
 	       VSYN_HSYN_WIDTH_PW_H(m->hsync_end - m->hsync_start),
 	       lcdif->base + LCDC_V8_VSYN_HSYN_WIDTH);
 
-	writel(CTRLDESCL0_1_HEIGHT(m->crtc_vdisplay) |
-	       CTRLDESCL0_1_WIDTH(m->crtc_hdisplay),
+	writel(CTRLDESCL0_1_HEIGHT(m->vdisplay) |
+	       CTRLDESCL0_1_WIDTH(m->hdisplay),
 	       lcdif->base + LCDC_V8_CTRLDESCL0_1);
 
 	writel(CTRLDESCL0_3_PITCH(lcdif->crtc.primary->state->fb->pitches[0]),
Signature · 1 line
2.35.1
#2 lore raw

Re: [PATCH v2 2/4] drm/lcdif: Consistently use plane timings

Quoted 17 lines · Marek Vasut

Drop the crtc_ prefix from mode, consistently use the plain one.

Fixes 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF

variant")

Cc Alexander Stein <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Liu Ying <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Martyn Welch <[email protected]>
Cc Peng Fan <[email protected]>
Cc Robby Cai <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stefan Agner <[email protected]>
Quoted 3 lines

---
V2: Add RB from Liu
Replace plane with plain

Do the replacement for the patch subject as well please. Perhaps, someone may pick this up and fix that for you.

Regards,
Liu Ying

author maintainer
#3 lore raw

PATCH v2 3/4 drm/lcdif: Clean up debug prints and comments

In reply to Marek Vasut

Update debug print to report bridge timings over connector ones. Drop missed comment commit from mxsfb.

Fixes 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Cc Alexander Stein <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Liu Ying <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Martyn Welch <[email protected]>
Cc Peng Fan <[email protected]>
Cc Robby Cai <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stefan Agner <[email protected]>

---
V2: Add RB from Liu

---
 drivers/gpu/drm/mxsfb/lcdif_kms.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/mxsfb/lcdif_kms.c +1 -2
index 829b0a6bb0d3f..9a77c631300a4 100644
@@ -204,7 +204,7 @@ static void lcdif_crtc_mode_set_nofb(struct lcdif_drm_private *lcdif,
 	DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n",
 			     m->crtc_clock,
 			     (int)(clk_get_rate(lcdif->clk) / 1000));
-	DRM_DEV_DEBUG_DRIVER(drm->dev, "Connector bus_flags: 0x%08X\n",
+	DRM_DEV_DEBUG_DRIVER(drm->dev, "Bridge bus_flags: 0x%08X\n",
 			     bus_flags);
 	DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags);
 
@@ -296,7 +296,6 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc,
 
 	lcdif_crtc_mode_set_nofb(lcdif, bridge_state, bus_format);
 
-	/* Write cur_buf as well to avoid an initial corrupt frame */
 	paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
 	if (paddr) {
 		writel(lower_32_bits(paddr),
Signature · 1 line
2.35.1
author maintainer
#4 lore raw

PATCH v2 4/4 drm/lcdif: switch to devm_drm_of_get_bridge

In reply to Marek Vasut

The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge".

Switch to the new function and reduce boilerplate.

Fixes 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Cc Alexander Stein <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Liu Ying <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Martyn Welch <[email protected]>
Cc Peng Fan <[email protected]>
Cc Robby Cai <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stefan Agner <[email protected]>

---
V2: Add RB from Liu

---
 drivers/gpu/drm/mxsfb/lcdif_drv.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)
drivers/gpu/drm/mxsfb/lcdif_drv.c +3 -15
index 1370889c6d687..746a4261f3da2 100644
@@ -42,23 +42,11 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
 {
 	struct drm_device *drm = lcdif->drm;
 	struct drm_bridge *bridge;
-	struct drm_panel *panel;
 	int ret;
 
-	ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel,
-					  &bridge);
-	if (ret)
-		return ret;
-
-	if (panel) {
-		bridge = devm_drm_panel_bridge_add_typed(drm->dev, panel,
-							 DRM_MODE_CONNECTOR_DPI);
-		if (IS_ERR(bridge))
-			return PTR_ERR(bridge);
-	}
-
-	if (!bridge)
-		return -ENODEV;
+	bridge = devm_drm_of_get_bridge(drm->dev, drm->dev->of_node, 0, 0);
+	if (IS_ERR(bridge))
+		return PTR_ERR(bridge);
 
 	ret = drm_bridge_attach(&lcdif->encoder, bridge, NULL, 0);
 	if (ret)
Signature · 1 line
2.35.1