From nobody Sun Feb 8 23:32:06 2026 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71CEB215077 for ; Thu, 18 Dec 2025 13:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766064412; cv=none; b=bLEycMnW6CYje938CWxw8Jn03LLS2A+LcaMDanlWaqvf5g66dkVUfvq0+B1JKeY4srzulTrI1uacuEayiAsnPPLYRSgU8o2PF5U5WwLvn+2eEAjiG9miMvhVFEa/GvIdj/E9WyElEiUyfntLuOmhAiqThNAWVk3TJGb5Ugm/wc0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766064412; c=relaxed/simple; bh=ykS7JdsTZDTvpcv0YzakxnBGh6GHP2mr6Lt81AtHCBs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=cU46lhmErANB9wUt/YEI3FQmORSSxJ4Gg4Q4yLn6P/snQtX/vt2xEJhFm+qT5FnEGrV8C0FZLTm5fkIj7hzMspxiSYbYXJIgK6BCyD6eHlo7jAqZyMYi8yI6/Cgp0ioH5iEgdKh/vb0Zj6+i75h55Hii9LGp/wBm8puA/r6LXYs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=N/0q2gD6; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="N/0q2gD6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1766064409; x=1797600409; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=ykS7JdsTZDTvpcv0YzakxnBGh6GHP2mr6Lt81AtHCBs=; b=N/0q2gD6FTjBxJXZFzBWu7uF1yFBc3kxOOUmeNRY6kiqkGBg6GGC5+7I l+xRmBbQTcrB/7iss6rTnkS5Rd1T+esIRupKnRh5Pa/d3mruRX95ByBk2 8i0hIyhd/Ecp4IfXYJhq1LPVeG5OXPTEWlSghawc51YLZP92ych2GyXqG +Wse94/aNiOuFK04BnwxD94Kjr/cfguImTBeWIWpeyKJBQPofuVhumeri C8MWwE8M2ihD4UeOzkEwRU9LuRoVq+SWbqcCNL80NCTNnfypBGNNcQPe5 PzaafA72mrAzBadQtt6qptIDx4d2DwYkjaFAncTvOhbq+N3drutfzBhqg w==; X-CSE-ConnectionGUID: 2/lmXmCJRTiQR6o8m97H0g== X-CSE-MsgGUID: PhUthTZ0Raq5orPdfntDFQ== X-IronPort-AV: E=Sophos;i="6.21,158,1763449200"; d="scan'208";a="218051100" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2025 06:26:47 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex3.mchp-main.com (10.10.87.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.29; Thu, 18 Dec 2025 06:26:29 -0700 Received: from [127.0.0.1] (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Thu, 18 Dec 2025 06:26:25 -0700 From: Ludovic Desroches Date: Thu, 18 Dec 2025 14:26:02 +0100 Subject: [PATCH v2 4/8] drm/atmel-hlcdc: use drm_crtc_mask() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20251218-lcd_cleanup_mainline-v2-4-df837aba878f@microchip.com> References: <20251218-lcd_cleanup_mainline-v2-0-df837aba878f@microchip.com> In-Reply-To: <20251218-lcd_cleanup_mainline-v2-0-df837aba878f@microchip.com> To: Manikandan Muralidharan , "Dharma Balasubiramani" , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea CC: , , , Ludovic Desroches X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2760; i=ludovic.desroches@microchip.com; h=from:subject:message-id; bh=ykS7JdsTZDTvpcv0YzakxnBGh6GHP2mr6Lt81AtHCBs=; b=owEBbQKS/ZANAwAKAT455hP3e2QtAcsmYgBpRADxRbWuT2hrcX6yP1BWK5UPErl8Wdu+60zVH DPtxvh9+XyJAjMEAAEKAB0WIQQAMEvJiWmsW41tNU0+OeYT93tkLQUCaUQA8QAKCRA+OeYT93tk LWBzEACSRyjecbrWJOgRkgaRknQr4y87xN9b40XBCceydVJdxFtlZHN2955/Mapd/6mWtKaPROc 2+7fwAM1hm7oTOiMCRIPoZwVoDocTJo1sk6HTSFeotA+oDPGsAnXCU+Q6jWOULBse9cLGJB+qEt eFhOnbmjBRLeeoje0o6LMucCs1+DPWUlJpA8R7sNms8KJz0aPd0Breec9ksjCrH2AuTpbC/yRPY YtIg6GJVuOyz59e+kLB9G0V65bxbvS6zxPyJwNxaUVO3jqxIdi8unELts7G3HlEWrt/oAsChXrG /+YCWVwh6bEG3jEKhA628FYUpwEMUysECds+LGYTqbuxWX5tnpDSyEZEq6tLPZPR6MTIrAYZ9HQ BX3Pv3AJRI9+VQwJZSCm1z+uuy8QfXVQx8eC1nck0mGXYZoFJuZ+Zy5QH1Y0PwSax18fS66ZAEK 5elHcp3QOqmel4zUxY/W5C8L/6pmiOI+IQX/XadVP2skDe+gi7hFqIPW9FVLq7Enb225kE8mcmz 0lkFy1QOAaJsgHNy099zFIzuYFkpCHOOs3D/qeHxfY7Kes0qRdbnseUA/nWiHzI/Js/diAPsson RMeCJFx8bXDGc8XrGt5NxZ15OSi2PH3DZ3MpgHUhMrAd5gdkV6Wa9HhbSLuyOyLYtXUM24WEYB4 dPnTmhxMJm+uv2g== X-Developer-Key: i=ludovic.desroches@microchip.com; a=openpgp; fpr=665BAA7297BE089A28B77696E332995F09DCC11A 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 Reviewed-by: Manikandan Muralidharan --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 12 ++++++------ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 4 +++- 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 8ff582a394794aacf84f9e23fd59f123445926a3..d1f5451ebfeaf81c382b49d0c1a= 6c3c32e44866b 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_devi= ce *dev) =20 drm_mode_config_init(dev); =20 - ret =3D atmel_hlcdc_create_outputs(dev); - if (ret) { - drm_err(dev, "failed to create HLCDC outputs: %d\n", ret); - return ret; - } - ret =3D 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_devi= ce *dev) return ret; } =20 + ret =3D 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 =3D dc->desc->min_width; dev->mode_config.min_height =3D dc->desc->min_height; dev->mode_config.max_width =3D 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 1f43e0feeedae54321a17efc266654e72e8b9d8e..e582315f70a119f2b39057ff112= bc427117b85f5 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 =3D dev->dev_private; + struct drm_crtc *crtc =3D dc->crtc; int ret; =20 ret =3D 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) } =20 =20 - output->encoder.possible_crtcs =3D 0x1; =20 if (panel) { bridge =3D drm_panel_bridge_add_typed(panel, @@ -103,6 +104,7 @@ static int atmel_hlcdc_attach_endpoint(struct drm_devic= e *dev, int endpoint) if (IS_ERR(bridge)) return PTR_ERR(bridge); } + output->encoder.possible_crtcs =3D drm_crtc_mask(crtc); =20 if (bridge) { ret =3D drm_bridge_attach(&output->encoder, bridge, NULL, 0); --=20 2.51.0