From: Javier Martinez Canillas <javierm@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
jfalempe@redhat.com, jose.exposito89@gmail.com,
arthurgrillo@riseup.net, mairacanal@riseup.net,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, daniel@ffwll.ch, noralf@tronnes.org
Cc: David Lechner <david@lechnology.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH v2 2/5] drm/format-helper: Pass xfrm buffer to format-conversion helpers
Date: Fri, 29 Sep 2023 11:04:56 +0200 [thread overview]
Message-ID: <87h6nd4afb.fsf@minerva.mail-host-address-is-not-set> (raw)
In-Reply-To: <20230920142535.19321-3-tzimmermann@suse.de>
Thomas Zimmermann <tzimmermann@suse.de> writes:
Hello Thomas,
> Pass an instance of struct drm_xfrm_buf to DRM's format conversion
> helpers. Update all callers. Drivers will later be able to keep this
> cache across display updates.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: Javier Martinez Canillas <javierm@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: David Lechner <david@lechnology.com>
> ---
[...]
> diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
> index 5a80b228d18ca..d11079733bc0e 100644
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
> @@ -571,6 +571,7 @@ static int ssd130x_fb_blit_rect(struct drm_plane_state *state,
> struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev);
> unsigned int page_height = ssd130x->device_info->page_height;
> struct ssd130x_plane_state *ssd130x_state = to_ssd130x_plane_state(state);
> + struct drm_xfrm_buf xfrm = DRM_XFRM_BUF_INIT;
I would prefer if this structure is a field of struct ssd130x_plane_state.
Since ssd130x_primary_plane_helper_atomic_check() zero allocates that, it
will have the same initial values as set by DRM_XFRM_BUF_INIT.
Alternatively you can do a drmm_xfrm_buf_init() + drm_xfrm_buf_reserve()
in ssd130x_primary_plane_helper_atomic_check().
> u8 *buf = ssd130x_state->buffer;
and struct drm_xfrm_buf *xfrm = &ssd130x_state->xfrm;
> struct iosys_map dst;
> unsigned int dst_pitch;
> @@ -587,12 +588,14 @@ static int ssd130x_fb_blit_rect(struct drm_plane_state *state,
> return ret;
>
> iosys_map_set_vaddr(&dst, buf);
> - drm_fb_xrgb8888_to_mono(&dst, &dst_pitch, vmap, fb, rect);
> + drm_fb_xrgb8888_to_mono(&dst, &dst_pitch, vmap, fb, rect, &xfrm);
>
> drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
>
> ssd130x_update_rect(ssd130x, ssd130x_state, rect);
>
> + drm_xfrm_buf_release(&xfrm);
> +
and you can release it in ssd130x_primary_plane_destroy_state().
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
next prev parent reply other threads:[~2023-09-29 9:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 14:24 [PATCH v2 0/5] drm: Reuse temporary memory for format conversion Thomas Zimmermann
2023-09-20 14:24 ` [PATCH v2 1/5] drm/format-helper: Add struct drm_xfrm_buf to cache " Thomas Zimmermann
2023-09-29 8:27 ` Javier Martinez Canillas
2023-10-04 7:08 ` Thomas Zimmermann
2023-10-04 7:30 ` Javier Martinez Canillas
2023-09-20 14:24 ` [PATCH v2 2/5] drm/format-helper: Pass xfrm buffer to format-conversion helpers Thomas Zimmermann
2023-09-29 9:04 ` Javier Martinez Canillas [this message]
2023-09-20 14:24 ` [PATCH v2 3/5] drm/simpledrm: Store xfrm buffer in device instance Thomas Zimmermann
2023-09-26 7:31 ` Jocelyn Falempe
2023-09-28 8:15 ` Thomas Zimmermann
2023-09-20 14:24 ` [PATCH v2 4/5] drm/ofdrm: " Thomas Zimmermann
2023-09-20 14:24 ` [PATCH v2 5/5] drm/ssd130x: " Thomas Zimmermann
2023-09-29 9:16 ` Javier Martinez Canillas
2023-09-26 7:28 ` [PATCH v2 0/5] drm: Reuse temporary memory for format conversion Jocelyn Falempe
2023-09-29 12:11 ` Maxime Ripard
2023-09-29 14:58 ` Thomas Zimmermann
2023-10-02 13:24 ` Maxime Ripard
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=87h6nd4afb.fsf@minerva.mail-host-address-is-not-set \
--to=javierm@redhat.com \
--cc=airlied@gmail.com \
--cc=arthurgrillo@riseup.net \
--cc=daniel@ffwll.ch \
--cc=david@lechnology.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jfalempe@redhat.com \
--cc=jose.exposito89@gmail.com \
--cc=kraxel@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mairacanal@riseup.net \
--cc=mripard@kernel.org \
--cc=noralf@tronnes.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.