All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Noralf Trønnes" <noralf@tronnes.org>,
	javierm@redhat.com, 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
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	dri-devel@lists.freedesktop.org,
	David Lechner <david@lechnology.com>
Subject: Re: [PATCH v4 3/7] drm/format-helper: Pass format-conversion state to helpers
Date: Thu, 5 Oct 2023 13:15:27 +0200	[thread overview]
Message-ID: <b6a60bd7-b187-4925-b711-9fd5e73d911c@suse.de> (raw)
In-Reply-To: <a079e75b-291a-4faf-7c56-19aa784df34c@tronnes.org>


[-- Attachment #1.1: Type: text/plain, Size: 3968 bytes --]

Hi

Am 05.10.23 um 13:10 schrieb Noralf Trønnes:
> 
> 
> On 10/5/23 11:04, Thomas Zimmermann wrote:
>> Pass an instance of struct drm_format_conv_state to DRM's format
>> conversion helpers. Update all callers.
>>
>> Most drivers can use the format-conversion state from their shadow-
>> plane state. The shadow plane's destroy function releases the
>> allocated buffer. Drivers will later be able to allocate a buffer
>> of appropriate size in their plane's atomic_check code.
>>
>> The gud driver uses a separate thread for committing updates. For
>> now, the update worker contains its own format-conversion state.
>>
>> Images in the format-helper tests are small. The tests preallocate
>> a static page for the temporary buffer. Unloading the module releases
>> the memory.
>>
>> v3:
>> 	* store buffer in shadow-plane state (Javier, Maxime)
>> 	* replace ARRAY_SIZE() with sizeof() (Jani)
>>
>> 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/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c
>> index 37c499ae4fe4f..b9b3dadf7b5f8 100644
>> --- a/drivers/gpu/drm/drm_format_helper.c
>> +++ b/drivers/gpu/drm/drm_format_helper.c
> 
>> @@ -328,6 +324,7 @@ static void drm_fb_swab32_line(void *dbuf, const void *sbuf, unsigned int pixels
>>    * @fb: DRM framebuffer
>>    * @clip: Clip rectangle area to copy
>>    * @cached: Source buffer is mapped cached (eg. not write-combined)
>> + * @xfrm: Transform and conversion state
> 
> Here and throughout the patch: xfrm does not match the argument name.

Thanks! I should be more careful when renaming.

> 
>>    *
>>    * This function copies parts of a framebuffer to display memory and swaps per-pixel
>>    * bytes during the process. Destination and framebuffer formats must match. The
>> @@ -342,7 +339,8 @@ static void drm_fb_swab32_line(void *dbuf, const void *sbuf, unsigned int pixels
>>    */
>>   void drm_fb_swab(struct iosys_map *dst, const unsigned int *dst_pitch,
>>   		 const struct iosys_map *src, const struct drm_framebuffer *fb,
>> -		 const struct drm_rect *clip, bool cached)
>> +		 const struct drm_rect *clip, bool cached,
>> +		 struct drm_format_conv_state *state)
>>   {
>>   	const struct drm_format_info *format = fb->format;
>>   	u8 cpp = DIV_ROUND_UP(drm_format_info_bpp(format, 0), 8);
> 
> 
>> diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
>> index 73dd4f4289c20..826fb20dbbf0d 100644
>> --- a/drivers/gpu/drm/tiny/repaper.c
>> +++ b/drivers/gpu/drm/tiny/repaper.c
> 
>> @@ -830,13 +831,14 @@ static void repaper_pipe_update(struct drm_simple_display_pipe *pipe,
>>   				struct drm_plane_state *old_state)
>>   {
>>   	struct drm_plane_state *state = pipe->plane.state;
>> +	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state);
>>   	struct drm_rect rect;
>>   
>>   	if (!pipe->crtc.state->active)
>>   		return;
>>   
>>   	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
>> -		repaper_fb_dirty(state->fb);
>> +		repaper_fb_dirty(state->fb, &shadow_plane_state->fmtcnv_state);
> 
> This won't work since repaper doesn't use the shadow plane helper.

Indeed. It can use a local buffer. But I'm a bit surprised to find that 
there are no shadow-plane helpers here. That sounds like a useful 
follow-up patch.

Best regards
Thomas

> 
> Noralf.
> 
>>   }
>>   
>>   static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs = {

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2023-10-05 11:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05  9:04 [PATCH v4 0/7] drm: Reuse temporary memory for format conversion Thomas Zimmermann
2023-10-05  9:04 ` [PATCH v4 1/7] drm/format-helper: Cache buffers with struct drm_format_conv_state Thomas Zimmermann
2023-10-05 11:01   ` Noralf Trønnes
2023-10-05 13:18   ` Javier Martinez Canillas
2023-10-05 14:55     ` Thomas Zimmermann
2023-10-05 15:26       ` Javier Martinez Canillas
2023-10-05  9:04 ` [PATCH v4 2/7] drm/atomic-helper: Add format-conversion state to shadow-plane state Thomas Zimmermann
2023-10-05 11:02   ` Noralf Trønnes
2023-10-05 13:26   ` Javier Martinez Canillas
2023-10-05  9:04 ` [PATCH v4 3/7] drm/format-helper: Pass format-conversion state to helpers Thomas Zimmermann
2023-10-05 11:06   ` kernel test robot
2023-10-05 11:06     ` kernel test robot
2023-10-05 11:10   ` Noralf Trønnes
2023-10-05 11:15     ` Thomas Zimmermann [this message]
2023-10-05 13:28   ` Javier Martinez Canillas
2023-10-05  9:04 ` [PATCH v4 4/7] drm/ofdrm: Preallocate format-conversion buffer in atomic_check Thomas Zimmermann
2023-10-05 13:35   ` Javier Martinez Canillas
2023-10-05  9:04 ` [PATCH v4 5/7] drm/simpledrm: " Thomas Zimmermann
2023-10-05 13:38   ` Javier Martinez Canillas
2023-10-09  8:42     ` Thomas Zimmermann
2023-10-09  8:58       ` Javier Martinez Canillas
2023-10-09  9:16         ` Thomas Zimmermann
2023-10-09  9:24           ` Javier Martinez Canillas
2023-10-05  9:04 ` [PATCH v4 6/7] drm/ssd130x: Fix atomic_check for disabled planes Thomas Zimmermann
2023-10-05  9:15   ` Geert Uytterhoeven
2023-10-05 11:37   ` Javier Martinez Canillas
2023-10-05 11:54     ` Thomas Zimmermann
2023-10-05 12:54       ` Javier Martinez Canillas
2023-10-05 12:58         ` Javier Martinez Canillas
2023-10-05  9:04 ` [PATCH v4 7/7] drm/ssd130x: Preallocate format-conversion buffer in atomic_check Thomas Zimmermann
2023-10-05 11:43   ` Javier Martinez Canillas
2023-10-06 14:49 ` [PATCH v4 0/7] drm: Reuse temporary memory for format conversion Maxime Ripard
2023-10-09  8:23   ` Thomas Zimmermann
2023-10-10  9:55     ` Maxime Ripard
2023-10-07 12:01 ` Noralf Trønnes
2023-10-09  7:53   ` Thomas Zimmermann

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=b6a60bd7-b187-4925-b711-9fd5e73d911c@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=arthurgrillo@riseup.net \
    --cc=daniel@ffwll.ch \
    --cc=david@lechnology.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --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 \
    /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.