All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org, kraxel@redhat.com,
	airlied@redhat.com, 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 15:25:44 +0100	[thread overview]
Message-ID: <20191204142544.GA20926@ravnborg.org> (raw)
In-Reply-To: <20191204132430.16874-4-tzimmermann@suse.de>

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?

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

  reply	other threads:[~2019-12-04 14:25 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 [this message]
2019-12-04 15:54     ` Thomas Zimmermann
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=20191204142544.GA20926@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=kraxel@redhat.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 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.