]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/atmel-hlcdc: use drm_crtc_mask()
authorLudovic Desroches <ludovic.desroches@microchip.com>
Thu, 18 Dec 2025 13:26:02 +0000 (14:26 +0100)
committerManikandan Muralidharan <manikandan.m@microchip.com>
Tue, 20 Jan 2026 10:22:47 +0000 (15:52 +0530)
Prefer using the drm_crtc_mask() helper instead of a raw value. It
involves reordering components initialization as we need a valid crtc.

Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Link: https://patch.msgid.link/20251218-lcd_cleanup_mainline-v2-4-df837aba878f@microchip.com
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c

index 8ff582a394794aacf84f9e23fd59f123445926a3..d1f5451ebfeaf81c382b49d0c1a6c3c32e44866b 100644 (file)
@@ -723,12 +723,6 @@ static int atmel_hlcdc_dc_modeset_init(struct drm_device *dev)
 
        drm_mode_config_init(dev);
 
-       ret = atmel_hlcdc_create_outputs(dev);
-       if (ret) {
-               drm_err(dev, "failed to create HLCDC outputs: %d\n", ret);
-               return ret;
-       }
-
        ret = atmel_hlcdc_create_planes(dev);
        if (ret) {
                drm_err(dev, "failed to create planes: %d\n", ret);
@@ -741,6 +735,12 @@ static int atmel_hlcdc_dc_modeset_init(struct drm_device *dev)
                return ret;
        }
 
+       ret = atmel_hlcdc_create_outputs(dev);
+       if (ret) {
+               drm_err(dev, "failed to create HLCDC outputs: %d\n", ret);
+               return ret;
+       }
+
        dev->mode_config.min_width = dc->desc->min_width;
        dev->mode_config.min_height = dc->desc->min_height;
        dev->mode_config.max_width = dc->desc->max_width;
index 1f43e0feeedae54321a17efc266654e72e8b9d8e..e582315f70a119f2b39057ff112bc427117b85f5 100644 (file)
@@ -71,6 +71,8 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
        struct device_node *ep;
        struct drm_panel *panel;
        struct drm_bridge *bridge;
+       struct atmel_hlcdc_dc *dc = dev->dev_private;
+       struct drm_crtc *crtc = dc->crtc;
        int ret;
 
        ret = drm_of_find_panel_or_bridge(dev->dev->of_node, 0, endpoint,
@@ -95,7 +97,6 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
        }
 
 
-       output->encoder.possible_crtcs = 0x1;
 
        if (panel) {
                bridge = drm_panel_bridge_add_typed(panel,
@@ -103,6 +104,7 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
                if (IS_ERR(bridge))
                        return PTR_ERR(bridge);
        }
+       output->encoder.possible_crtcs = drm_crtc_mask(crtc);
 
        if (bridge) {
                ret = drm_bridge_attach(&output->encoder, bridge, NULL, 0);