From: Maxime Ripard <maxime@cerno.tech>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: hamohammed.sa@gmail.com, rodrigosiqueiramelo@gmail.com,
airlied@linux.ie, dri-devel@lists.freedesktop.org,
melissa.srw@gmail.com, noralf@tronnes.org
Subject: Re: [PATCH 1/5] drm: Define DRM_FORMAT_MAX_PLANES
Date: Fri, 16 Jul 2021 09:30:44 +0200 [thread overview]
Message-ID: <20210716073044.ff3avcrd5swruele@gilmour> (raw)
In-Reply-To: <20210715180133.3675-2-tzimmermann@suse.de>
Hi,
On Thu, Jul 15, 2021 at 08:01:29PM +0200, Thomas Zimmermann wrote:
> DRM uses a magic number of 4 for the maximum number of planes per color
> format. Declare this constant via DRM_FORMAT_MAX_PLANES and update the
> related code.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/drm_gem_framebuffer_helper.c | 14 ++++++++------
> include/drm/drm_fourcc.h | 13 +++++++++----
> include/drm/drm_framebuffer.h | 8 ++++----
> include/drm/drm_gem_atomic_helper.h | 2 +-
> 4 files changed, 22 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> index e2c68822e05c..975a3df0561e 100644
> --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> @@ -48,7 +48,7 @@
> struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
> unsigned int plane)
> {
> - if (plane >= 4)
> + if (plane >= ARRAY_SIZE(fb->obj))
> return NULL;
This doesn't look related to what's mentionned in the commit log though?
> return fb->obj[plane];
> @@ -62,7 +62,8 @@ drm_gem_fb_init(struct drm_device *dev,
> struct drm_gem_object **obj, unsigned int num_planes,
> const struct drm_framebuffer_funcs *funcs)
> {
> - int ret, i;
> + unsigned int i;
> + int ret;
>
> drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd);
>
> @@ -86,9 +87,9 @@ drm_gem_fb_init(struct drm_device *dev,
> */
> void drm_gem_fb_destroy(struct drm_framebuffer *fb)
> {
> - int i;
> + size_t i;
>
> - for (i = 0; i < 4; i++)
> + for (i = 0; i < ARRAY_SIZE(fb->obj); i++)
> drm_gem_object_put(fb->obj[i]);
Ditto
Both these changes look fine though, but I guess you should just mention it
Maxime
next prev parent reply other threads:[~2021-07-16 7:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-15 18:01 [PATCH 0/5] drm: Provide framebuffer vmap helpers Thomas Zimmermann
2021-07-15 18:01 ` [PATCH 1/5] drm: Define DRM_FORMAT_MAX_PLANES Thomas Zimmermann
2021-07-16 7:30 ` Maxime Ripard [this message]
2021-07-16 8:50 ` Thomas Zimmermann
2021-07-18 13:23 ` kernel test robot
2021-07-15 18:01 ` [PATCH 2/5] drm/gem: Provide drm_gem_fb_{vmap,vunmap}() Thomas Zimmermann
2021-07-15 22:31 ` kernel test robot
2021-07-16 0:52 ` kernel test robot
2021-07-15 18:01 ` [PATCH 3/5] drm/gem: Clear mapping addresses for unused framebuffer planes Thomas Zimmermann
2021-07-15 18:01 ` [PATCH 4/5] drm/gud: Map framebuffer BOs with drm_gem_fb_vmap() Thomas Zimmermann
2021-07-22 11:49 ` Noralf Trønnes
2021-07-15 18:01 ` [PATCH 5/5] drm/vkms: Map output " Thomas Zimmermann
2021-07-16 2:28 ` kernel test robot
[not found] <202107160729.dsfkD3VR-lkp@intel.com>
2021-07-16 9:03 ` [PATCH 1/5] drm: Define DRM_FORMAT_MAX_PLANES kernel test robot
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=20210716073044.ff3avcrd5swruele@gilmour \
--to=maxime@cerno.tech \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=melissa.srw@gmail.com \
--cc=noralf@tronnes.org \
--cc=rodrigosiqueiramelo@gmail.com \
--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