From: <Manikandan.M@microchip.com>
To: <Ludovic.Desroches@microchip.com>, <Dharma.B@microchip.com>,
<maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
<tzimmermann@suse.de>, <airlied@gmail.com>, <simona@ffwll.ch>,
<Nicolas.Ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
<claudiu.beznea@tuxon.dev>
Cc: <dri-devel@lists.freedesktop.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/atmel-hlcdc: don't reject the commit if the src rect has fractional parts
Date: Mon, 5 Jan 2026 07:06:46 +0000 [thread overview]
Message-ID: <43c48e38-021e-4e3a-b872-b89c90108b54@microchip.com> (raw)
In-Reply-To: <20251120-lcd_scaling_fix-v1-1-5ffc98557923@microchip.com>
On 20/11/25 4:08 pm, Ludovic Desroches wrote:
> Don’t reject the commit when the source rectangle has fractional parts.
> This can occur due to scaling: drm_atomic_helper_check_plane_state() calls
> drm_rect_clip_scaled(), which may introduce fractional parts while
> computing the clipped source rectangle. This does not imply the commit is
> invalid, so we should accept it instead of discarding it.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Thanks Ludovic.
> ---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 19 ++++---------------
> 1 file changed, 4 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index 92132be9823f1e705d266f9547702ea9530bd043..bccfe055c087e5632d60503e8e4bcb3d9e18ce50 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -79,8 +79,6 @@ drm_plane_state_to_atmel_hlcdc_plane_state(struct drm_plane_state *s)
> return container_of(s, struct atmel_hlcdc_plane_state, base);
> }
>
> -#define SUBPIXEL_MASK 0xffff
> -
> static uint32_t rgb_formats[] = {
> DRM_FORMAT_C8,
> DRM_FORMAT_XRGB4444,
> @@ -745,24 +743,15 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
> if (ret || !s->visible)
> return ret;
>
> - hstate->src_x = s->src.x1;
> - hstate->src_y = s->src.y1;
> - hstate->src_w = drm_rect_width(&s->src);
> - hstate->src_h = drm_rect_height(&s->src);
> + hstate->src_x = s->src.x1 >> 16;
> + hstate->src_y = s->src.y1 >> 16;
> + hstate->src_w = drm_rect_width(&s->src) >> 16;
> + hstate->src_h = drm_rect_height(&s->src) >> 16;
> hstate->crtc_x = s->dst.x1;
> hstate->crtc_y = s->dst.y1;
> hstate->crtc_w = drm_rect_width(&s->dst);
> hstate->crtc_h = drm_rect_height(&s->dst);
>
> - if ((hstate->src_x | hstate->src_y | hstate->src_w | hstate->src_h) &
> - SUBPIXEL_MASK)
> - return -EINVAL;
> -
> - hstate->src_x >>= 16;
> - hstate->src_y >>= 16;
> - hstate->src_w >>= 16;
> - hstate->src_h >>= 16;
> -
> hstate->nplanes = fb->format->num_planes;
> if (hstate->nplanes > ATMEL_HLCDC_LAYER_MAX_PLANES)
> return -EINVAL;
>
> ---
> base-commit: fe4d0dea039f2befb93f27569593ec209843b0f5
> change-id: 20251119-lcd_scaling_fix-a4842d86307c
>
> Best regards,
--
Thanks and Regards,
Manikandan M.
next prev parent reply other threads:[~2026-01-05 7:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 10:38 Ludovic Desroches
2026-01-05 7:06 ` Manikandan.M [this message]
2026-01-21 4:24 ` Manikandan.M
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=43c48e38-021e-4e3a-b872-b89c90108b54@microchip.com \
--to=manikandan.m@microchip.com \
--cc=Dharma.B@microchip.com \
--cc=Ludovic.Desroches@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=airlied@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--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®