[RFC,4/8] drm/mxsfb: Switch to drm_mode_config_create_initial_state()

Message ID 20261122153032.2782768-5-dario.binacchi@amarulasolutions.com
State New
Headers
Series drm: State readout for the i.MX8MN display pipeline |

Commit Message

Dario Binacchi Nov. 22, 2026, 3:30 p.m. UTC
The hardware state is read out only when the initial state is created
with drm_mode_config_create_initial_state().

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.43.0
  

Comments

Maxime Ripard Nov. 23, 2026, 10:54 a.m. UTC | #1
On Sun, Nov 22, 2026 at 04:30:04PM +0100, Dario Binacchi wrote:
> The hardware state is read out only when the initial state is created
> with drm_mode_config_create_initial_state().
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

That's 99da25e15ccb in drm-misc-next

Maxime
  

Patch

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 038f5c896dcb..c8bc79264361 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -322,7 +322,11 @@  static int mxsfb_load(struct drm_device *drm,
 	drm->mode_config.funcs		= &mxsfb_mode_config_funcs;
 	drm->mode_config.helper_private	= &mxsfb_mode_config_helpers;
 
-	drm_mode_config_reset(drm);
+	ret = drm_mode_config_create_initial_state(drm);
+	if (ret) {
+		dev_err(drm->dev, "Failed to create initial state\n");
+		goto err_vblank;
+	}
 
 	ret = platform_get_irq(pdev, 0);
 	if (ret < 0)