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>
This commit is contained in:
Ludovic Desroches 2025-12-18 14:26:02 +01:00 committed by Manikandan Muralidharan
parent 227ef8cf93
commit 07972c070f
2 changed files with 9 additions and 7 deletions

View 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;

View 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);