mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Louis Chauvet <louis.chauvet@bootlin.com>
To: "Cristian Ciocaltea" <cristian.ciocaltea@collabora.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Sandy Huang" <hjc@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Andy Yan" <andy.yan@rock-chips.com>,
	"Haneen Mohammed" <hamohammed.sa@gmail.com>,
	"Melissa Wen" <melissa.srw@gmail.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: "Robert Mader" <robert.mader@collabora.com>,
	kernel@collabora.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Diederik de Haas" <diederik@cknow-tech.com>
Subject: Re: [PATCH v7 3/4] drm/vkms: Support setting custom background color
Date: Fri, 6 Feb 2026 15:04:51 +0100	[thread overview]
Message-ID: <e6dd0f45-1d64-48b8-bc76-43cc29fabec2@bootlin.com> (raw)
In-Reply-To: <20260204-rk3588-bgcolor-v7-3-78d1d01c5ca1@collabora.com>



On 2/4/26 21:02, Cristian Ciocaltea wrote:
> Make use of the BACKGROUND_COLOR CRTC property when filling the
> background during blending.  It already defaults to solid black.
> 
> Since the internal representation of the pixel color in VKMS relies on
> 16 bits of precision, use the newly introduced DRM_ARGB64_GET{R|G|B}()
> helpers to access the individual components of the background color
> property, which is compliant with DRM_FORMAT_ARGB16161616.
> 
> It's worth noting the alpha component is ignored, hence non-opaque
> background colors are not supported.
> 
> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>

> Tested-by: Diederik de Haas <diederik@cknow-tech.com>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>   drivers/gpu/drm/vkms/vkms_composer.c | 10 ++++++++--
>   drivers/gpu/drm/vkms/vkms_crtc.c     |  3 +++
>   2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c
> index cd85de4ffd03..83d217085ad0 100644
> --- a/drivers/gpu/drm/vkms/vkms_composer.c
> +++ b/drivers/gpu/drm/vkms/vkms_composer.c
> @@ -475,8 +475,14 @@ static void blend(struct vkms_writeback_job *wb,
>   {
>   	struct vkms_plane_state **plane = crtc_state->active_planes;
>   	u32 n_active_planes = crtc_state->num_active_planes;
> -
> -	const struct pixel_argb_u16 background_color = { .a = 0xffff };
> +	u64 bgcolor = crtc_state->base.background_color;
> +
> +	const struct pixel_argb_u16 background_color = {
> +		.a = 0xffff,
> +		.r = DRM_ARGB64_GETR(bgcolor),
> +		.g = DRM_ARGB64_GETG(bgcolor),
> +		.b = DRM_ARGB64_GETB(bgcolor),
> +	};
>   
>   	int crtc_y_limit = crtc_state->base.mode.vdisplay;
>   	int crtc_x_limit = crtc_state->base.mode.hdisplay;
> diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
> index 9a7db1d51022..2514c367f710 100644
> --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> @@ -4,6 +4,7 @@
>   
>   #include <drm/drm_atomic.h>
>   #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_blend.h>
>   #include <drm/drm_managed.h>
>   #include <drm/drm_print.h>
>   #include <drm/drm_probe_helper.h>
> @@ -228,6 +229,8 @@ struct vkms_output *vkms_crtc_init(struct drm_device *dev, struct drm_plane *pri
>   
>   	drm_crtc_enable_color_mgmt(crtc, 0, false, VKMS_LUT_SIZE);
>   
> +	drm_crtc_attach_background_color_property(crtc);
> +
>   	spin_lock_init(&vkms_out->lock);
>   	spin_lock_init(&vkms_out->composer_lock);
>   
> 


  reply	other threads:[~2026-02-06 14:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 20:02 [PATCH v7 0/4] Introduce BACKGROUND_COLOR DRM CRTC property Cristian Ciocaltea
2026-02-04 20:02 ` [PATCH v7 1/4] uapi: Provide DIV_ROUND_CLOSEST() Cristian Ciocaltea
2026-02-04 20:02 ` [PATCH v7 2/4] drm: Add CRTC background color property Cristian Ciocaltea
2026-02-04 20:02 ` [PATCH v7 3/4] drm/vkms: Support setting custom background color Cristian Ciocaltea
2026-02-06 14:04   ` Louis Chauvet [this message]
2026-02-04 20:02 ` [PATCH v7 4/4] drm/rockchip: vop2: " Cristian Ciocaltea
2026-02-14  7:41   ` Andy Yan
2026-02-16 14:56 ` [PATCH v7 0/4] Introduce BACKGROUND_COLOR DRM CRTC property Maarten Lankhorst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6dd0f45-1d64-48b8-bc76-43cc29fabec2@bootlin.com \
    --to=louis.chauvet@bootlin.com \
    --cc=airlied@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=cristian.ciocaltea@collabora.com \
    --cc=diederik@cknow-tech.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=nfraprado@collabora.com \
    --cc=robert.mader@collabora.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®