From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org,
"Maíra Canal" <mairacanal@riseup.net>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"David Gow" <davidgow@google.com>,
"José Expósito" <jose.exposito89@gmail.com>,
"Arthur Grillo" <arthurgrillo@riseup.net>
Subject: Re: [PATCH] drm/format-helper: Use drm_format_info_min_pitch() in tests helper
Date: Fri, 17 Mar 2023 09:08:09 +0100 [thread overview]
Message-ID: <0a1a0765-8f9c-90f5-b848-2931904269a7@suse.de> (raw)
In-Reply-To: <20230316223404.102806-1-javierm@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1642 bytes --]
Am 16.03.23 um 23:34 schrieb Javier Martinez Canillas:
> There's a nice macro to calculate the destination pitch that already takes
> into account sub-byte pixel formats. Use that instead of open coding it.
>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>
> drivers/gpu/drm/tests/drm_format_helper_test.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b/drivers/gpu/drm/tests/drm_format_helper_test.c
> index bfa47f8ffd09..474bb7a1c4ee 100644
> --- a/drivers/gpu/drm/tests/drm_format_helper_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
> @@ -440,15 +440,12 @@ static size_t conversion_buf_size(u32 dst_format, unsigned int dst_pitch,
> const struct drm_rect *clip)
> {
> const struct drm_format_info *dst_fi = drm_format_info(dst_format);
> - unsigned int bpp;
>
> if (!dst_fi)
> return -EINVAL;
>
> - if (!dst_pitch) {
> - bpp = drm_format_info_bpp(dst_fi, 0);
> - dst_pitch = DIV_ROUND_UP(drm_rect_width(clip) * bpp, 8);
> - }
> + if (!dst_pitch)
> + dst_pitch = drm_format_info_min_pitch(dst_fi, 0, drm_rect_width(clip));
>
> return dst_pitch * drm_rect_height(clip);
> }
>
> base-commit: 165d5133731a2e045abdd6d9d3c9221fdc2a556e
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2023-03-17 8:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 22:34 Javier Martinez Canillas
2023-03-17 8:08 ` Thomas Zimmermann [this message]
2023-03-17 17:38 ` Javier Martinez Canillas
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=0a1a0765-8f9c-90f5-b848-2931904269a7@suse.de \
--to=tzimmermann@suse.de \
--cc=arthurgrillo@riseup.net \
--cc=davidgow@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=javierm@redhat.com \
--cc=jose.exposito89@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mairacanal@riseup.net \
/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®