All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: airlied@redhat.com, kraxel@redhat.com,
	dri-devel@lists.freedesktop.org, emil.velikov@collabora.com
Subject: Re: [PATCH 3/7] drm/udl: Vmap framebuffer after all tests succeeded in damage handling
Date: Wed, 4 Dec 2019 16:54:30 +0100	[thread overview]
Message-ID: <8fe45822-c34a-e18c-4f01-77ea710ab8e1@suse.de> (raw)
In-Reply-To: <20191204142544.GA20926@ravnborg.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2716 bytes --]

Hi Sam

Am 04.12.19 um 15:25 schrieb Sam Ravnborg:
> Hi Thomas.
> 
> I did a casual browse of the patches.
> Looks like some nice cleanup.
> 
> On Wed, Dec 04, 2019 at 02:24:26PM +0100, Thomas Zimmermann wrote:
>> We now do the fast tests before the potentially expensive vmap operation.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>  drivers/gpu/drm/udl/udl_fb.c       | 19 +++++++------------
>>  drivers/gpu/drm/udl/udl_transfer.c |  1 -
>>  2 files changed, 7 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
>> index ed6d9476b25b..dd7ba7f63214 100644
>> --- a/drivers/gpu/drm/udl/udl_fb.c
>> +++ b/drivers/gpu/drm/udl/udl_fb.c
>> @@ -85,12 +85,6 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
>>  	}
>>  	spin_unlock(&udl->active_fb_16_lock);
>>  
>> -	vaddr = drm_gem_shmem_vmap(fb->obj[0]);
>> -	if (IS_ERR(vaddr)) {
>> -		DRM_ERROR("failed to vmap fb\n");
>> -		return 0;
>> -	}
>> -
>>  	aligned_x = DL_ALIGN_DOWN(x, sizeof(unsigned long));
>>  	width = DL_ALIGN_UP(width + (x-aligned_x), sizeof(unsigned long));
>>  	x = aligned_x;
>> @@ -98,8 +92,13 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
>>  	if ((width <= 0) ||
>>  	    (x + width > fb->width) ||
>>  	    (y + height > fb->height)) {
>> -		ret = -EINVAL;
>> -		goto err_drm_gem_shmem_vunmap;
>> +		return -EINVAL;
>> +	}
>> +
>> +	vaddr = drm_gem_shmem_vmap(fb->obj[0]);
>> +	if (IS_ERR(vaddr)) {
>> +		DRM_ERROR("failed to vmap fb\n");
>> +		return 0;
>>  	}
>>  
>>  	urb = udl_get_urb(dev);
>> @@ -131,10 +130,6 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
>>  	drm_gem_shmem_vunmap(fb->obj[0], vaddr);
>>  
>>  	return 0;
>> -
>> -err_drm_gem_shmem_vunmap:
>> -	drm_gem_shmem_vunmap(fb->obj[0], vaddr);
>> -	return ret;
> This label is reintroduced two patches later.
> Is this on purpose it is gone and reintroduced?

This label is for rollback during error handling. The label in [6/7] is
called out_drm_gem_shmem_vunmap and it's part of the regular flow.

Admittedly, it's a bit unfortunate. OTOH the alternative is to add
dma-buf calls before moving around the vmap call. That seems like the
worse option.

Best regards
Thomas

> 
> 	Sam
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


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

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-12-04 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 13:24 [PATCH 0/7] drm/udl: Prepare damage handler for simple-pipe KMS Thomas Zimmermann
2019-12-04 13:24 ` [PATCH 1/7] drm/udl: Remove unused statistics counters Thomas Zimmermann
2019-12-04 13:24 ` [PATCH 2/7] drm/udl: Don't track number of identical and sent pixels per line Thomas Zimmermann
2019-12-04 13:24 ` [PATCH 3/7] drm/udl: Vmap framebuffer after all tests succeeded in damage handling Thomas Zimmermann
2019-12-04 14:25   ` Sam Ravnborg
2019-12-04 15:54     ` Thomas Zimmermann [this message]
2019-12-04 13:24 ` [PATCH 4/7] drm/udl: Move clip-rectangle code out of udl_handle_damage() Thomas Zimmermann
2019-12-04 13:24 ` [PATCH 5/7] drm/udl: Move log-cpp code out of udl_damage_handler() Thomas Zimmermann
2019-12-04 13:24 ` [PATCH 6/7] drm/udl: Begin/end access to imported buffers in damage-handler Thomas Zimmermann
2019-12-05 13:25   ` Emil Velikov
2019-12-04 13:24 ` [PATCH 7/7] drm/udl: Remove field lost_pixels from struct udl_device Thomas Zimmermann
2019-12-05  8:15 ` [PATCH 0/7] drm/udl: Prepare damage handler for simple-pipe KMS Gerd Hoffmann
2019-12-05 13:31 ` Emil Velikov

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=8fe45822-c34a-e18c-4f01-77ea710ab8e1@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=kraxel@redhat.com \
    --cc=sam@ravnborg.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.