From nobody Wed Oct 1 22:39:17 2025 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 0AD8017996 for ; Mon, 29 Sep 2025 04:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759120694; cv=none; b=ZgwWYt+g08tt+HoMKPGQVAdsLiBYSVImbq1DPtuU9CNCJXP7DoS0BMc3oMK4W7KDsUkMr4P59uJ3cRB45Utndq/1OwGBZxbxOBJ1VgCcsuWQ5sxX7FhP2JoPZEccWo246MJetD1rcFEPEa9AhCqdHka9f1tM5nesyLdJTVOCgM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759120694; c=relaxed/simple; bh=s/GCqPbeU4Eg1kMDOx5dQW1GJij75/kzPn0IXx5jF4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=aTMvbSx9C/dynov/JzF9ubgAHkXuTmsShE4rXduglSZ1rW0SkPGD2lVOAwbDqYC3v9vDi1fQT+u0qmNzvU++G9aWnIqfvZgZ297zH8+JiwkugRYDQwZDFlzRXtpXbEKc4Mh7tDkUE1DPia6n5AbZCX0nSVpin+UHOygyCrJyM4s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=R0XsjvQO; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="R0XsjvQO" Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20250929042918epoutp03125b6fbbacfb23e270c21247e1ef3ada~ppnbNw1Z40479804798epoutp037 for ; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20250929042918epoutp03125b6fbbacfb23e270c21247e1ef3ada~ppnbNw1Z40479804798epoutp037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1759120158; bh=Y74o6IOjQgwfeEIGmmm1c1vskXSR4OXN85rOUOM1PX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R0XsjvQO+w1Ywh/1MWZByziR5BfBr4OS6m4H5t/GbWJBGk96Xb/JCHvlf+g67jDlC d3EJbm23myQ3qL4Tf8Ls24OmhMo2avzGux+usuUDPXTdrfMJnnbeqx0Mvr4YvkijTT G0YjvAWsx3vMmqs9xaDfH0Dq+0Up3HB37e6Y3sJM= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPS id 20250929042918epcas2p2580ef12c45a153d3b0312026dfaf0c63~ppnavDpyh1831418314epcas2p2S; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) Received: from epcas2p3.samsung.com (unknown [182.195.38.208]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4cZp9n5bpbz6B9mJ; Mon, 29 Sep 2025 04:29:17 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20250929042917epcas2p4c8f375cc2355b3a48141cdddb04a01c4~ppnZ5GzZ60613506135epcas2p4p; Mon, 29 Sep 2025 04:29:17 +0000 (GMT) Received: from tayo (unknown [10.229.9.198]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250929042917epsmtip1030b8011b124a863d36bf014cdf0ad72~ppnZ0uSI12522725227epsmtip1m; Mon, 29 Sep 2025 04:29:17 +0000 (GMT) From: Hoyoung Lee To: Inki Dae , Seung-Woo Kim , Kyungmin Park , David Airlie , Simona Vetter , Krzysztof Kozlowski , Alim Akhtar Cc: Hoyoung Lee , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] drm/exynos: plane: Disable fully off-screen planes instead of zero-sized update Date: Mon, 29 Sep 2025 13:31:08 +0900 Message-ID: <20250929043110.3631025-2-hy_fifty.lee@samsung.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250929043110.3631025-1-hy_fifty.lee@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20250929042917epcas2p4c8f375cc2355b3a48141cdddb04a01c4 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P cpgsPolicy: CPGSC10-234,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250929042917epcas2p4c8f375cc2355b3a48141cdddb04a01c4 References: <20250929043110.3631025-1-hy_fifty.lee@samsung.com> Some configurations require additional actions when all windows are disabled to keep DECON operating correctly. Programming a zero-sized window in ->atomic_update() leaves the plane logically enabled and can bypass those disable semantics. Treat a fully off-screen plane as not visible and take the explicit disable path. Implementation details: - exynos_plane_mode_set(): if computed actual_w/actual_h is zero, mark state->visible =3D false and return early. - exynos_plane_atomic_check(): if !visible, skip further checks and return 0. - exynos_plane_atomic_update(): if !visible, call ->disable_plane(); otherwise call ->update_plane(). No functional change for visible planes; off-screen planes are now cleanly disabled, ensuring the disable hooks run consistently. Signed-off-by: Hoyoung Lee --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/ex= ynos/exynos_drm_plane.c index 7c3aa77186d3..842974154d79 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -91,6 +91,11 @@ static void exynos_plane_mode_set(struct exynos_drm_plan= e_state *exynos_state) actual_w =3D exynos_plane_get_size(crtc_x, crtc_w, mode->hdisplay); actual_h =3D exynos_plane_get_size(crtc_y, crtc_h, mode->vdisplay); =20 + if (!actual_w || !actual_h) { + state->visible =3D false; + return; + } + if (crtc_x < 0) { if (actual_w) src_x +=3D ((-crtc_x) * exynos_state->h_ratio) >> 16; @@ -244,6 +249,9 @@ static int exynos_plane_atomic_check(struct drm_plane *= plane, /* translate state into exynos_state */ exynos_plane_mode_set(exynos_state); =20 + if (!new_plane_state->visible) + return 0; + ret =3D exynos_drm_plane_check_format(exynos_plane->config, exynos_state); if (ret) return ret; @@ -263,8 +271,10 @@ static void exynos_plane_atomic_update(struct drm_plan= e *plane, if (!new_state->crtc) return; =20 - if (exynos_crtc->ops->update_plane) + if (new_state->visible && exynos_crtc->ops->update_plane) exynos_crtc->ops->update_plane(exynos_crtc, exynos_plane); + else if (exynos_crtc->ops->disable_plane) + exynos_crtc->ops->disable_plane(exynos_crtc, exynos_plane); } =20 static void exynos_plane_atomic_disable(struct drm_plane *plane, --=20 2.34.1 From nobody Wed Oct 1 22:39:17 2025 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (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 89A8A207A3A for ; Mon, 29 Sep 2025 04:29:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759120170; cv=none; b=RhJVRc6bfROCHGl0GAYRqsnzqyU9fO6xai9qPBolZytyVpDqQjnSkEyFkL8+vuxB09VsPqiwnvOFvV+WcIAQMJpKxvdagml93R+X6VyS36aNe0vkpdEVttIyid52nwFsoXedJZtDNENyrab7TsHxLuKeFxTKOzOjvvvTsKaGyHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759120170; c=relaxed/simple; bh=AZ6DU3ilvbOOxYJWW+oCWHWJRZAnAtVHtvLx7NoNWk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=lhX5f4NuAeBSsqDNDWtb1suzYWapxkwUWI/syzZJkol9z5p6Wx0HlBkaAF1E9oxsAZW+GqV7c1M/e/biCq3Ik8DVPHL2AOIj6xK4qXj9OBoKUlV90/oLINFyQUMPVOUbkg3nyieMAPtvxxi9algFEZKAdrk7JxLx+A0aZvmrtpU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=X5vFgjR2; arc=none smtp.client-ip=203.254.224.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="X5vFgjR2" Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20250929042918epoutp01c8bcdb3dd39c506763ff5d3ba376f46d~ppnbU_d0q0389303893epoutp01k for ; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20250929042918epoutp01c8bcdb3dd39c506763ff5d3ba376f46d~ppnbU_d0q0389303893epoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1759120158; bh=YSVaMtuyuSZZ1up/bnEVaaqJsX9Frjk4SuqMGWpTs64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X5vFgjR2l4L6b7NiucO1Gnr+xHkgGl7MZYoIVi7/uLllwe5iBIprnPGKf3ll2Zguf cu/LtcY53z+eZg9Xst/Aoi8cRnWVpdkmvD5DBBITb7R9hDBy8Enyynq0XV1LVBLCjD 2aLer6162rjBn6jLXpdKON84Mub2r+6cUmDCEtGU= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPS id 20250929042918epcas2p389736ec498c2e1e07be26be0e12c7636~ppna6NSXN1841018410epcas2p3d; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) Received: from epcas2p3.samsung.com (unknown [182.195.38.205]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4cZp9p0SkJz6B9mG; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20250929042917epcas2p2569e213500997dfa6ba43c8f361f50f7~ppnZ_6lVS1831418314epcas2p2O; Mon, 29 Sep 2025 04:29:17 +0000 (GMT) Received: from tayo (unknown [10.229.9.198]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250929042917epsmtip1cd0804751a75e6720cbf5da675545d7a~ppnZ5hi7v2403224032epsmtip1i; Mon, 29 Sep 2025 04:29:17 +0000 (GMT) From: Hoyoung Lee To: Inki Dae , Seung-Woo Kim , Kyungmin Park , David Airlie , Simona Vetter , Krzysztof Kozlowski , Alim Akhtar Cc: Hoyoung Lee , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] drm/exynos: Convert to drmm_mode_config_init() and drop manual cleanup Date: Mon, 29 Sep 2025 13:31:09 +0900 Message-ID: <20250929043110.3631025-3-hy_fifty.lee@samsung.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250929043110.3631025-1-hy_fifty.lee@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20250929042917epcas2p2569e213500997dfa6ba43c8f361f50f7 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P cpgsPolicy: CPGSC10-234,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250929042917epcas2p2569e213500997dfa6ba43c8f361f50f7 References: <20250929043110.3631025-1-hy_fifty.lee@samsung.com> Switch mode-config initialization to drmm_mode_config_init() so that the lifetime is tied to drm_device. Remove explicit drm_mode_config_cleanup() from error and unbind paths since cleanup is now managed by DRM. No functional change intended. Signed-off-by: Hoyoung Lee --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exyn= os/exynos_drm_drv.c index 6cc7bf77bcac..1aea71778ab1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -257,7 +257,7 @@ static int exynos_drm_bind(struct device *dev) dev_set_drvdata(dev, drm); drm->dev_private =3D (void *)private; =20 - drm_mode_config_init(drm); + drmm_mode_config_init(drm); =20 exynos_drm_mode_config_init(drm); =20 @@ -297,7 +297,6 @@ static int exynos_drm_bind(struct device *dev) err_unbind_all: component_unbind_all(drm->dev, drm); err_mode_config_cleanup: - drm_mode_config_cleanup(drm); exynos_drm_cleanup_dma(drm); kfree(private); dev_set_drvdata(dev, NULL); @@ -317,7 +316,6 @@ static void exynos_drm_unbind(struct device *dev) drm_atomic_helper_shutdown(drm); =20 component_unbind_all(drm->dev, drm); - drm_mode_config_cleanup(drm); exynos_drm_cleanup_dma(drm); =20 kfree(drm->dev_private); --=20 2.34.1 From nobody Wed Oct 1 22:39:17 2025 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 0AD40E56A for ; Mon, 29 Sep 2025 04:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759120695; cv=none; b=QOzkB7jHfFAU/mFqPIKyzJ26HRaJUDulv5q0DIzrap238JCvDg47kq3yyGHFqysb0OFM0jXzvW4IIF4dHV4viiZQ9S9oAO3TXqodIlAtan6bkcIbeBMX79N8jV3Sw376jr01hdPEhFUknJZO20+19lj9MY5eWOwTOzFFZBI01sg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759120695; c=relaxed/simple; bh=OvLdDTiYvksMV0SFUsHZ+qTPxY8hy9wo6dzSepf0uUs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:MIME-Version: Content-Type:References; b=KGluzKpS+JseKRVItuQdGfZtZ+EZzMjENdHU/xwfAWZtJs5oypfPepZbr4Vxz6INGAZIuc3CJ8S0wjELP82PzZ61fnmtYDawRUSfuCjwbVMni/laNS24kJ+jcLq87/31zG20b/Vunnaso7GzU6SkgeO5C77oyvLpGjubZqHj90w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=LqKTPS89; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="LqKTPS89" Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20250929042918epoutp03009cfddf8e19c9505c71aabcf30de4e3~ppnbgQtpd0476904769epoutp03S for ; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20250929042918epoutp03009cfddf8e19c9505c71aabcf30de4e3~ppnbgQtpd0476904769epoutp03S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1759120159; bh=6sXHbeK++urRgXFZ0q5BURM+QBMH1xJNpaG+x/fCF18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LqKTPS89TRCiFaXTZaUlQaYINomJBLLho1jnkGuv5dhMizXUKnXmSgTeC58TpgeFv ELRtB+i2iW3eHXV+sp9sIC6gI7GmnhWzz7Fvsic8/u4WvjYIOVN3QPEYx+hfiAshrQ KAT0IruBjF6DpPCg/+OUKWSQ2pliEtUV7fY7tL5o= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPS id 20250929042918epcas2p48ba6d48b41c6fdd147cf6c6850617c73~ppnbAiqdy1362413624epcas2p4W; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) Received: from epcas2p3.samsung.com (unknown [182.195.38.205]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4cZp9p0Y7Mz6B9mL; Mon, 29 Sep 2025 04:29:18 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20250929042917epcas2p43d95408c9c43ff49ff6674136d7c64d3~ppnaD-lQX0591205912epcas2p4u; Mon, 29 Sep 2025 04:29:17 +0000 (GMT) Received: from tayo (unknown [10.229.9.198]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250929042917epsmtip1dc25e0c7a28d5a3a5ce6ffb1ebdba5be~ppnZ-VBh52522725227epsmtip1n; Mon, 29 Sep 2025 04:29:17 +0000 (GMT) From: Hoyoung Lee To: Inki Dae , Seung-Woo Kim , Kyungmin Park , David Airlie , Simona Vetter , Krzysztof Kozlowski , Alim Akhtar Cc: Hoyoung Lee , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] drm/exynos: Move mode_config setup from fb.c to drv.c Date: Mon, 29 Sep 2025 13:31:10 +0900 Message-ID: <20250929043110.3631025-4-hy_fifty.lee@samsung.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250929043110.3631025-1-hy_fifty.lee@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20250929042917epcas2p43d95408c9c43ff49ff6674136d7c64d3 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P cpgsPolicy: CPGSC10-234,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250929042917epcas2p43d95408c9c43ff49ff6674136d7c64d3 References: <20250929043110.3631025-1-hy_fifty.lee@samsung.com> Relocate exynos_drm_mode_config_init() and the mode_config funcs/helpers from exynos_drm_fb.c to exynos_drm_drv.c, and invoke drm_mode_config_init() from inside exynos_drm_mode_config_init(). Rationale: resolve the historical fb.c placement, align with common DRM layering (mode_config is device-wide policy that belongs in the core driver), and make initialization order explicit before creating KMS objects and binding components. No functional change intended. Signed-off-by: Hoyoung Lee --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 47 ++++++++++++++++++++++--- drivers/gpu/drm/exynos/exynos_drm_fb.c | 34 ++---------------- drivers/gpu/drm/exynos/exynos_drm_fb.h | 7 ++-- 3 files changed, 49 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exyn= os/exynos_drm_drv.c index 1aea71778ab1..6362cd417a4e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -233,6 +233,43 @@ static struct component_match *exynos_drm_match_add(st= ruct device *dev) return match ?: ERR_PTR(-ENODEV); } =20 +static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = =3D { + .atomic_commit_tail =3D drm_atomic_helper_commit_tail_rpm, +}; + +static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs =3D= { + .fb_create =3D exynos_user_fb_create, + .atomic_check =3D drm_atomic_helper_check, + .atomic_commit =3D drm_atomic_helper_commit, +}; + +static int exynos_drm_mode_config_init(struct drm_device *dev) +{ + int ret; + + ret =3D drmm_mode_config_init(dev); + if (ret) + return ret; + + dev->mode_config.min_width =3D 0; + dev->mode_config.min_height =3D 0; + + /* + * set max width and height as default value(4096x4096). + * this value would be used to check framebuffer size limitation + * at drm_mode_addfb(). + */ + dev->mode_config.max_width =3D 4096; + dev->mode_config.max_height =3D 4096; + + dev->mode_config.funcs =3D &exynos_drm_mode_config_funcs; + dev->mode_config.helper_private =3D &exynos_drm_mode_config_helpers; + + dev->mode_config.normalize_zpos =3D true; + + return 0; +} + static int exynos_drm_bind(struct device *dev) { struct exynos_drm_private *private; @@ -257,9 +294,9 @@ static int exynos_drm_bind(struct device *dev) dev_set_drvdata(dev, drm); drm->dev_private =3D (void *)private; =20 - drmm_mode_config_init(drm); - - exynos_drm_mode_config_init(drm); + ret =3D exynos_drm_mode_config_init(drm); + if (ret) + goto err_free_private; =20 /* setup possible_clones. */ clone_mask =3D 0; @@ -272,7 +309,7 @@ static int exynos_drm_bind(struct device *dev) /* Try to bind all sub drivers. */ ret =3D component_bind_all(drm->dev, drm); if (ret) - goto err_mode_config_cleanup; + goto err_free_private; =20 ret =3D drm_vblank_init(drm, drm->mode_config.num_crtc); if (ret) @@ -296,7 +333,7 @@ static int exynos_drm_bind(struct device *dev) drm_kms_helper_poll_fini(drm); err_unbind_all: component_unbind_all(drm->dev, drm); -err_mode_config_cleanup: +err_free_private: exynos_drm_cleanup_dma(drm); kfree(private); dev_set_drvdata(dev, NULL); diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exyno= s/exynos_drm_fb.c index ddd73e7f26a3..c118a079d308 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -8,8 +8,7 @@ * Seung-Woo Kim */ =20 -#include -#include +#include #include #include #include @@ -93,7 +92,7 @@ exynos_drm_framebuffer_init(struct drm_device *dev, return ERR_PTR(ret); } =20 -static struct drm_framebuffer * +struct drm_framebuffer * exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, const struct drm_format_info *info, const struct drm_mode_fb_cmd2 *mode_cmd) @@ -150,32 +149,3 @@ dma_addr_t exynos_drm_fb_dma_addr(struct drm_framebuff= er *fb, int index) exynos_gem =3D to_exynos_gem(fb->obj[index]); return exynos_gem->dma_addr + fb->offsets[index]; } - -static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = =3D { - .atomic_commit_tail =3D drm_atomic_helper_commit_tail_rpm, -}; - -static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs =3D= { - .fb_create =3D exynos_user_fb_create, - .atomic_check =3D drm_atomic_helper_check, - .atomic_commit =3D drm_atomic_helper_commit, -}; - -void exynos_drm_mode_config_init(struct drm_device *dev) -{ - dev->mode_config.min_width =3D 0; - dev->mode_config.min_height =3D 0; - - /* - * set max width and height as default value(4096x4096). - * this value would be used to check framebuffer size limitation - * at drm_mode_addfb(). - */ - dev->mode_config.max_width =3D 4096; - dev->mode_config.max_height =3D 4096; - - dev->mode_config.funcs =3D &exynos_drm_mode_config_funcs; - dev->mode_config.helper_private =3D &exynos_drm_mode_config_helpers; - - dev->mode_config.normalize_zpos =3D true; -} diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.h b/drivers/gpu/drm/exyno= s/exynos_drm_fb.h index fdc6cb40cc9c..0c79ce5d4a8d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.h +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.h @@ -19,8 +19,11 @@ exynos_drm_framebuffer_init(struct drm_device *dev, struct exynos_drm_gem **exynos_gem, int count); =20 -dma_addr_t exynos_drm_fb_dma_addr(struct drm_framebuffer *fb, int index); +struct drm_framebuffer * +exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, + const struct drm_format_info *info, + const struct drm_mode_fb_cmd2 *mode_cmd); =20 -void exynos_drm_mode_config_init(struct drm_device *dev); +dma_addr_t exynos_drm_fb_dma_addr(struct drm_framebuffer *fb, int index); =20 #endif --=20 2.34.1