summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLudovic Desroches <ludovic.desroches@microchip.com>2025-12-18 14:26:02 +0100
committerManikandan Muralidharan <manikandan.m@microchip.com>2026-01-20 15:52:47 +0530
commit07972c070f4879a621b3194662b90ff66e25d666 (patch)
treecc81f11c40f6f225235329941a40e84bb4d9baeb /drivers/gpu
parent227ef8cf93a5328642d844d0f61dbd941e90a2a9 (diff)
drm/atmel-hlcdc: use drm_crtc_mask()
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c12
-rw-r--r--drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c4
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 8ff582a39479..d1f5451ebfea 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -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;
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
index 1f43e0feeeda..e582315f70a1 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
@@ -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);