From: "Andy Yan" <andyshrk@163•com>
To: "Alexey Charkov" <alchark@flipper•net>
Cc: "Sandy Huang" <hjc@rock-chips•com>,
"Heiko Stübner" <heiko@sntech•de>,
"Andy Yan" <andy.yan@rock-chips•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>,
"Cristian Ciocaltea" <cristian.ciocaltea@collabora•com>,
dri-devel@lists•freedesktop.org,
linux-arm-kernel@lists•infradead.org,
linux-rockchip@lists•infradead.org, linux-kernel@vger•kernel.org
Subject: Re:[PATCH 2/2] drm/rockchip: dw_hdmi_qp: expose "overscan" property
Date: Wed, 3 Jun 2026 21:11:05 +0800 (CST) [thread overview]
Message-ID: <6f7ae6e2.a68c.19e8d9be74d.Coremail.andyshrk@163.com> (raw)
In-Reply-To: <20260602-hdmi-overscan-v1-2-31f71b817c80@flipper.net>
Hello Alexy,
At 2026-06-03 01:00:40, "Alexey Charkov" <alchark@flipper•net> wrote:
>Expose the "overscan" connector property as recognized by KWin and the
>likes to compensate for TV overscan cropping.
>
>The CRTC will use the margin values derived from this overscan percentage
>in its post-composition scaler to add appropriate blank margins on all
>sides of the output image so that the TV doesn't eat up visible content.
>
>Signed-off-by: Alexey Charkov <alchark@flipper•net>
>---
> drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
>diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
>index f35484715c2d..fae44d11dbef 100644
>--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
>+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
>@@ -137,10 +137,18 @@ dw_hdmi_qp_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
> struct drm_connector_state *conn_state)
> {
> struct rockchip_hdmi_qp *hdmi = to_rockchip_hdmi_qp(encoder);
>+ const struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode;
> struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);
> union phy_configure_opts phy_cfg = {};
>+ unsigned int overscan;
> int ret;
>
>+ overscan = min(conn_state->tv.overscan, 100u);
>+ s->tv_margins.left = adj_mode->hdisplay * overscan / 200;
>+ s->tv_margins.right = s->tv_margins.left;
>+ s->tv_margins.top = adj_mode->vdisplay * overscan / 200;
>+ s->tv_margins.bottom = s->tv_margins.top;
>+
> if (hdmi->tmds_char_rate == conn_state->hdmi.tmds_char_rate &&
> s->output_bpc == conn_state->hdmi.output_bpc)
> return 0;
>@@ -603,6 +611,14 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
> return dev_err_probe(hdmi->dev, PTR_ERR(connector),
> "Failed to init bridge connector\n");
>
>+ ret = drm_mode_create_tv_properties_legacy(drm, 0, NULL);
>+ if (ret)
>+ return dev_err_probe(dev, ret,
>+ "Failed to create TV connector properties\n");
I suggest calling a similar API within rockchip_drm_bind, and then attaching this property in
the connector drivers that need to expose it. This approach avoids invoking the API multiple times in multiple drivers。
>+
>+ drm_object_attach_property(&connector->base,
>+ drm->mode_config.tv_overscan_property, 0);
>+
> return 0;
> }
>
>
>--
>2.52.0
>
>
>_______________________________________________
>Linux-rockchip mailing list
>Linux-rockchip@lists•infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-rockchip
prev parent reply other threads:[~2026-06-03 13:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 17:00 [PATCH 0/2] drm/rockchip: dw_hdmi_qp: Add support for HDMI overscan compensation Alexey Charkov
2026-06-02 17:00 ` [PATCH 1/2] drm/rockchip: vop2: honor TV margins from CRTC state for " Alexey Charkov
2026-06-02 17:00 ` [PATCH 2/2] drm/rockchip: dw_hdmi_qp: expose "overscan" property Alexey Charkov
2026-06-03 7:55 ` Maxime Ripard
2026-06-03 8:15 ` Alexey Charkov
2026-06-03 13:11 ` Andy Yan [this message]
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=6f7ae6e2.a68c.19e8d9be74d.Coremail.andyshrk@163.com \
--to=andyshrk@163$(echo .)com \
--cc=airlied@gmail$(echo .)com \
--cc=alchark@flipper$(echo .)net \
--cc=andy.yan@rock-chips$(echo .)com \
--cc=cristian.ciocaltea@collabora$(echo .)com \
--cc=dri-devel@lists$(echo .)freedesktop.org \
--cc=heiko@sntech$(echo .)de \
--cc=hjc@rock-chips$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-rockchip@lists$(echo .)infradead.org \
--cc=maarten.lankhorst@linux$(echo .)intel.com \
--cc=mripard@kernel$(echo .)org \
--cc=simona@ffwll$(echo .)ch \
--cc=tzimmermann@suse$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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