From nobody Fri Oct 3 10:15:35 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 C89112E62CB for ; Tue, 2 Sep 2025 09:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756805297; cv=none; b=hiBHORIuHxer5YeGBjfEo1NTixxVSLaMcBXRWSuRna+2xUkC/F5c8c4neUIwL/0c2a+cvQJHNFMlygdXFkpTzq0i0Xm9rjxt4Hhh+1Oxx26zsvBrodvdAGXyCCSgOWnyQb/qgpUkAeFz164qjgJw2KwnI0XF2WgTZ1c1vHlxcFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756805297; c=relaxed/simple; bh=YtwElPS8aR4gW4cx1Fi4f1c2ZQrNeyC9qjC7zQ2lfzM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FJxj7OornqhJwfGAHpOOEfIHNm/h4aI2A6AR8zcmx+WGJzaYYrkzpln4uF+0mB0i7wsYt2b7LrfI7X75n8M/KllmCCyDNvu9xdObJqJapfFGy/xpCOZmU9WxVtxRCkDqeOekaibb520jfk8v/H/URoy9aAuK3tKQPGY/5J8R8xg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=QLqWswT/; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QLqWswT/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756805287; bh=YtwElPS8aR4gW4cx1Fi4f1c2ZQrNeyC9qjC7zQ2lfzM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QLqWswT/plgp0WihKxXmc8Ek7MMT+Bv87dJrvqF7XJTaTKd3VbFvZ0fRjzzRp10Ou +81ctYoi0IN98HhTQP+pYTFSN/5wDzNXBl+EyANuCrkPbnOR2JTcd8pvtw328KTuQY XAYLHfJcI8750dVd0WKks/seZkLXC0jZbzxQYSIlBcSccN6sL/lzOKjPnnmfBxnY02 /fh0r4S08W3Z0whRPFKj/AISBrBnhMzHG2Dz++2bjo0JSiMNPEWvCn66TimZx6LYcn 72EOXt3RVBt5kJnBwtuZl2yWoQKZsrMS+FzeC6xC3Lu0LxKj7DfZWaMuOwxO8qOuou 28YSy7OXmP3Jg== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 0E23617E12B9; Tue, 2 Sep 2025 11:28:07 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 12:27:56 +0300 Subject: [PATCH 1/2] drm: Add CRTC background color property 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: <20250902-rk3588-bgcolor-v1-1-fd97df91d89f@collabora.com> References: <20250902-rk3588-bgcolor-v1-0-fd97df91d89f@collabora.com> In-Reply-To: <20250902-rk3588-bgcolor-v1-0-fd97df91d89f@collabora.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Matt Roper X-Mailer: b4 0.14.2 Some display controllers can be hardware programmed to show non-black colors for pixels that are either not covered by any plane or are exposed through transparent regions of higher planes. This feature can help reduce memory bandwidth usage, e.g. in compositors managing a UI with a solid background color while using smaller planes to render the remaining content. To support this capability, introduce the BACKGROUND_COLOR standard DRM mode property, which can be attached to a CRTC through the drm_crtc_attach_background_color_property() helper function. Additionally, define a 64-bit ARGB format value to be built with the help of a dedicated drm_argb64() utility macro. Individual color components can be extracted with desired precision using the corresponding DRM_ARGB64_*() macros. Co-developed-by: Matt Roper Signed-off-by: Matt Roper Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/drm_atomic_state_helper.c | 1 + drivers/gpu/drm/drm_atomic_uapi.c | 4 ++++ drivers/gpu/drm/drm_blend.c | 37 +++++++++++++++++++++++++++= ---- drivers/gpu/drm/drm_mode_config.c | 6 +++++ include/drm/drm_blend.h | 4 +++- include/drm/drm_crtc.h | 12 ++++++++++ include/drm/drm_mode_config.h | 5 +++++ include/uapi/drm/drm_mode.h | 30 +++++++++++++++++++++++++ 8 files changed, 94 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/dr= m_atomic_state_helper.c index 7142e163e618ea0d7d9d828e1bd9ff2a6ec0dfeb..359264cf467c5270b77f0b04548= 073bc92cb812e 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c @@ -75,6 +75,7 @@ __drm_atomic_helper_crtc_state_reset(struct drm_crtc_stat= e *crtc_state, struct drm_crtc *crtc) { crtc_state->crtc =3D crtc; + crtc_state->background_color =3D drm_argb64(0xffff, 0, 0, 0); } EXPORT_SYMBOL(__drm_atomic_helper_crtc_state_reset); =20 diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic= _uapi.c index 85dbdaa4a2e25878c953b9b41539c8566d55c6d9..a447cb119aaa6cd11348be77b39= f342a1386836d 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -407,6 +407,8 @@ static int drm_atomic_crtc_set_property(struct drm_crtc= *crtc, &replaced); state->color_mgmt_changed |=3D replaced; return ret; + } else if (property =3D=3D config->background_color_property) { + state->background_color =3D val; } else if (property =3D=3D config->prop_out_fence_ptr) { s32 __user *fence_ptr =3D u64_to_user_ptr(val); =20 @@ -452,6 +454,8 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc, *val =3D (state->ctm) ? state->ctm->base.id : 0; else if (property =3D=3D config->gamma_lut_property) *val =3D (state->gamma_lut) ? state->gamma_lut->base.id : 0; + else if (property =3D=3D config->background_color_property) + *val =3D state->background_color; else if (property =3D=3D config->prop_out_fence_ptr) *val =3D 0; else if (property =3D=3D crtc->scaling_filter_property) diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index 6852d73c931ce32e62062e2b8f8c5e38612d5210..5a287d12685b007a2732f510f62= 675f500e53727 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c @@ -191,10 +191,6 @@ * plane does not expose the "alpha" property, then this is * assumed to be 1.0 * - * Note that all the property extensions described here apply either to the - * plane or the CRTC (e.g. for the background color, which currently is not - * exposed and assumed to be black). - * * SCALING_FILTER: * Indicates scaling filter to be used for plane scaler * @@ -207,6 +203,23 @@ * * Drivers can set up this property for a plane by calling * drm_plane_create_scaling_filter_property + * + * The property extensions described above all apply to the plane. Drivers + * may also expose the following crtc property extension: + * + * BACKGROUND_COLOR: + * Background color is set via drm_crtc_attach_background_color_property(). + * It controls the ARGB color of a full-screen layer that exists below all + * planes. This color will be used for pixels not covered by any plane and + * may also be blended with plane contents as allowed by a plane's alpha + * values. The background color defaults to black, and is assumed to be + * black for drivers that do not expose this property. Although background + * color isn't a plane, it is assumed that the color provided here + * undergoes the same pipe-level degamma/CSC/gamma transformations that + * planes undergo. Note that the color value provided here includes an + * alpha channel, hence non-opaque background color values are allowed, but + * are generally only honored in special cases (e.g. when a memory + * writeback connector is in use). */ =20 /** @@ -621,3 +634,19 @@ int drm_plane_create_blend_mode_property(struct drm_pl= ane *plane, return 0; } EXPORT_SYMBOL(drm_plane_create_blend_mode_property); + +/** + * drm_crtc_attach_background_color_property - attach background color pro= perty + * @crtc: drm crtc + * + * Attaches the background color property to @crtc. The property defaults= to + * solid black and will accept 64-bit ARGB values in the format generated = by + * drm_argb64(). + */ +void drm_crtc_attach_background_color_property(struct drm_crtc *crtc) +{ + drm_object_attach_property(&crtc->base, + crtc->dev->mode_config.background_color_property, + drm_argb64(0xffff, 0, 0, 0)); +} +EXPORT_SYMBOL(drm_crtc_attach_background_color_property); diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_c= onfig.c index 25f376869b3a41d47bbe72b0df3e35cad142f3e6..6d70bfab45ca2bb81ed3ca1940f= d1cd85e8cc58e 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -375,6 +375,12 @@ static int drm_mode_create_standard_properties(struct = drm_device *dev) return -ENOMEM; dev->mode_config.gamma_lut_size_property =3D prop; =20 + prop =3D drm_property_create_range(dev, 0, + "BACKGROUND_COLOR", 0, U64_MAX); + if (!prop) + return -ENOMEM; + dev->mode_config.background_color_property =3D prop; + prop =3D drm_property_create(dev, DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_BLOB, "IN_FORMATS", 0); diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h index 88bdfec3bd8848acd1ef5742aaaa23483b332a2e..c7e888767c81c2745cd3cce88c1= 0db4bbe305d1e 100644 --- a/include/drm/drm_blend.h +++ b/include/drm/drm_blend.h @@ -31,8 +31,9 @@ #define DRM_MODE_BLEND_COVERAGE 1 #define DRM_MODE_BLEND_PIXEL_NONE 2 =20 -struct drm_device; struct drm_atomic_state; +struct drm_crtc; +struct drm_device; struct drm_plane; =20 static inline bool drm_rotation_90_or_270(unsigned int rotation) @@ -58,4 +59,5 @@ int drm_atomic_normalize_zpos(struct drm_device *dev, struct drm_atomic_state *state); int drm_plane_create_blend_mode_property(struct drm_plane *plane, unsigned int supported_modes); +void drm_crtc_attach_background_color_property(struct drm_crtc *crtc); #endif diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index caa56e039da2a748cf40ebf45b37158acda439d9..4653dacc1077b9ed8fb4cf27cc8= 4530ba1706f6a 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -274,6 +274,18 @@ struct drm_crtc_state { */ struct drm_property_blob *gamma_lut; =20 + /** + * @background_color: + * + * RGB value representing the pipe's background color. The background + * color (aka "canvas color") of a pipe is the color that will be used + * for pixels not covered by a plane, or covered by transparent pixels + * of a plane. The value here should be built using drm_argb64(), while + * the individual color components can be extracted with desired + * precision via the DRM_ARGB64_*() macros. + */ + u64 background_color; + /** * @target_vblank: * diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 2e848b816218584eb077ed887bf97705f012a622..ea422afec5c4108a223dc872e1b= 6835ffc596cc3 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -814,6 +814,11 @@ struct drm_mode_config { * gamma LUT as supported by the driver (read-only). */ struct drm_property *gamma_lut_size_property; + /** + * @background_color_property: Optional CRTC property to set the + * background color. + */ + struct drm_property *background_color_property; =20 /** * @suggested_x_property: Optional connector property with a hint for diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index a122bea2559387576150236e3a88f99c24ad3138..4bd6a8ca8868109bcbe21f9f6e9= 864519c9d03ec 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -1363,6 +1363,36 @@ struct drm_mode_closefb { __u32 pad; }; =20 +/* + * Put 16-bit ARGB values into a standard 64-bit representation that + * can be used for ioctl parameters, inter-driver communication, etc. + */ +static inline __u64 +drm_argb64(__u16 alpha, __u16 red, __u16 green, __u16 blue) +{ + return (__u64)alpha << 48 | (__u64)red << 32 | (__u64)green << 16 | blue; +} + +/* + * Extract the specified number of least-significant bits of a specific + * color component from a standard 64-bit ARGB value. + */ +#define DRM_ARGB64_COMP(c, shift, numlsb) \ + ((__u16)(((c) >> (shift)) & ((1UL << (numlsb) % 17) - 1))) +#define DRM_ARGB64_ALPHA_LSB(c, numlsb) DRM_ARGB64_COMP(c, 48, numlsb) +#define DRM_ARGB64_RED_LSB(c, numlsb) DRM_ARGB64_COMP(c, 32, numlsb) +#define DRM_ARGB64_GREEN_LSB(c, numlsb) DRM_ARGB64_COMP(c, 16, numlsb) +#define DRM_ARGB64_BLUE_LSB(c, numlsb) DRM_ARGB64_COMP(c, 0, numlsb) + +/* + * Convenience wrappers to extract all 16 bits of a specific color + * component from a standard 64-bit ARGB value. + */ +#define DRM_ARGB64_ALPHA(c) DRM_ARGB64_ALPHA_LSB(c, 16) +#define DRM_ARGB64_RED(c) DRM_ARGB64_RED_LSB(c, 16) +#define DRM_ARGB64_GREEN(c) DRM_ARGB64_GREEN_LSB(c, 16) +#define DRM_ARGB64_BLUE(c) DRM_ARGB64_BLUE_LSB(c, 16) + #if defined(__cplusplus) } #endif --=20 2.51.0 From nobody Fri Oct 3 10:15:35 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 5C7462E7160 for ; Tue, 2 Sep 2025 09:28:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756805297; cv=none; b=l3zyOK3lJ6apoLbwi48LVvzqPiO6UdL7tPQxE0G4Hn34zNDbMGjurZpr5cQGnRWZhRcY8Fi47Xc6KQkFT5YUwa0rUQIwpeSQyY9sgTndrrOZrE9ncgl5cEyuqta6oWhH1djRrau5xM6rP3yCaRQMFSNchIsBRdaD3RBmyhpXUQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756805297; c=relaxed/simple; bh=DJEgTveXx+nh3X2zirS8evwV7Zg17ZJfI1XFceEOvsc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dGQFZWrbWaqngOIICa9XLKnNA6irkTFZ4ZLqmhg5nQZOnIAloLyQu9U8jvMzz66LZp73r2cg4vZDA3H59sH1hRWVq+feM8aSZsdKbowdIQ93ZeyBNczyPa8heU0A2VgjVvGb4KIqcLijw2UdMUnH2Q1aLPUpCL4YDaVKKBCpiVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=plDeZ6Hr; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="plDeZ6Hr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756805288; bh=DJEgTveXx+nh3X2zirS8evwV7Zg17ZJfI1XFceEOvsc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=plDeZ6HrxNX2C/q5p3BHe1TkPU0Lea5RU6czuNfLVhtknWSnjblE75hMrtLzwKu37 Q8iKK/WW/a5j/KSQeD8wId5AEc6fgSQzo/oAAA2VxYAgR4L5SLrZdt94BtI1xHitz4 6Lc9YjqACRsoZ2SfiXT+YF0Y6g3xc1AZuJ2d5ONR2GzLnvUa1l8q0TgQupJXa+1r1X VS3Izs8F7LsSdeMfm3rHMmkwdoTLoz53bywuTZq649dwf1Er6kQPtMPKCPNWypcee/ cfanGtMIsLDj8e5DkDEOJMoSpKPWI/kcopLTXFdT3trXWpJPyeShcFngmS0j6c977N xgufOIwyjS+EA== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id D468417E1301; Tue, 2 Sep 2025 11:28:07 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 12:27:57 +0300 Subject: [PATCH 2/2] drm/rockchip: vop2: Support setting custom background color 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: <20250902-rk3588-bgcolor-v1-2-fd97df91d89f@collabora.com> References: <20250902-rk3588-bgcolor-v1-0-fd97df91d89f@collabora.com> In-Reply-To: <20250902-rk3588-bgcolor-v1-0-fd97df91d89f@collabora.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.14.2 VOP2 allows configuring the background color of each video output port. Since a previous patch introduced the BACKGROUND_COLOR CRTC property, which defaults to solid black, take it into account when programming the hardware. Note that only the 10 least significant bits of each color component are used, as this is the maximum precision supported by the display controller. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 13 ++++++++++++- drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm= /rockchip/rockchip_drm_vop2.c index b50927a824b4020a7ffd57974070ed202cd8b838..7fe060e7e58297d583b1396cf60= 6b7ba580b8e79 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -1548,6 +1548,7 @@ static void vop2_post_config(struct drm_crtc *crtc) struct vop2_video_port *vp =3D to_vop2_video_port(crtc); struct vop2 *vop2 =3D vp->vop2; struct drm_display_mode *mode =3D &crtc->state->adjusted_mode; + u64 bgcolor =3D crtc->state->background_color; u16 vtotal =3D mode->crtc_vtotal; u16 hdisplay =3D mode->crtc_hdisplay; u16 hact_st =3D mode->crtc_htotal - mode->crtc_hsync_start; @@ -1593,7 +1594,11 @@ static void vop2_post_config(struct drm_crtc *crtc) vop2_vp_write(vp, RK3568_VP_POST_DSP_VACT_INFO_F1, val); } =20 - vop2_vp_write(vp, RK3568_VP_DSP_BG, 0); + /* Background color is programmed with 10 bits of precision */ + val =3D FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_RED, DRM_ARGB64_RED(bgcolor)); + val |=3D FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_GREEN, DRM_ARGB64_GREEN(bgco= lor)); + val |=3D FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_BLUE, DRM_ARGB64_BLUE(bgcolo= r)); + vop2_vp_write(vp, RK3568_VP_DSP_BG, val); } =20 static int us_to_vertical_line(struct drm_display_mode *mode, int us) @@ -1972,6 +1977,10 @@ static int vop2_crtc_state_dump(struct drm_crtc *crt= c, struct seq_file *s) drm_get_bus_format_name(vcstate->bus_format)); seq_printf(s, "\toutput_mode[%x]", vcstate->output_mode); seq_printf(s, " color_space[%d]\n", vcstate->color_space); + seq_printf(s, "\tbackground color (10bpc): r=3D%x g=3D%x b=3D%x\n", + DRM_ARGB64_RED(cstate->background_color), + DRM_ARGB64_GREEN(cstate->background_color), + DRM_ARGB64_BLUE(cstate->background_color)); seq_printf(s, " Display mode: %dx%d%s%d\n", mode->hdisplay, mode->vdisplay, interlaced ? "i" : "p", drm_mode_vrefresh(mode)); @@ -2461,6 +2470,8 @@ static int vop2_create_crtcs(struct vop2 *vop2) return dev_err_probe(drm->dev, ret, "crtc init for video_port%d failed\n", i); =20 + drm_crtc_attach_background_color_property(&vp->crtc); + drm_crtc_helper_add(&vp->crtc, &vop2_crtc_helper_funcs); if (vop2->lut_regs) { const struct vop2_video_port_data *vp_data =3D &vop2_data->vp[vp->id]; diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h b/drivers/gpu/drm= /rockchip/rockchip_drm_vop2.h index fa5c56f16047e3493e82fbedaced221459696dcc..596558adc1207e837eb8eca49b3= 5d7a55d693f88 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h @@ -659,6 +659,10 @@ enum dst_factor_mode { #define RK3588_VP_CLK_CTRL__DCLK_OUT_DIV GENMASK(3, 2) #define RK3588_VP_CLK_CTRL__DCLK_CORE_DIV GENMASK(1, 0) =20 +#define RK3568_VP_DSP_BG__DSP_BG_RED GENMASK(29, 20) +#define RK3568_VP_DSP_BG__DSP_BG_GREEN GENMASK(19, 10) +#define RK3568_VP_DSP_BG__DSP_BG_BLUE GENMASK(9, 0) + #define RK3568_VP_POST_SCL_CTRL__VSCALEDOWN BIT(1) #define RK3568_VP_POST_SCL_CTRL__HSCALEDOWN BIT(0) =20 --=20 2.51.0