dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/cma: remove to make sg_table when gem cma is created
Date: Sat, 15 Mar 2014 11:51:04 +0100	[thread overview]
Message-ID: <1597993.bKFS5RgF3j@avalon> (raw)
In-Reply-To: <1394868628-11561-1-git-send-email-jy0922.shim@samsung.com>

Hi Joonyoung,

Thank you for the patch.

On Saturday 15 March 2014 16:30:28 Joonyoung Shim wrote:
> The sg_table made when gem cma is created isn't used anywhere. The sgt
> of struct drm_gem_cma_object will have only sg_tabel imported.
> 
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/drm_gem_cma_helper.c | 19 -------------------
>  1 file changed, 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c
> b/drivers/gpu/drm/drm_gem_cma_helper.c index 6b51bf9..2c07cb9 100644
> --- a/drivers/gpu/drm/drm_gem_cma_helper.c
> +++ b/drivers/gpu/drm/drm_gem_cma_helper.c
> @@ -79,7 +79,6 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct
> drm_device *drm, unsigned int size)
>  {
>  	struct drm_gem_cma_object *cma_obj;
> -	struct sg_table *sgt = NULL;
>  	int ret;
> 
>  	size = round_up(size, PAGE_SIZE);
> @@ -97,23 +96,9 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct
> drm_device *drm, goto error;
>  	}
> 
> -	sgt = kzalloc(sizeof(*cma_obj->sgt), GFP_KERNEL);
> -	if (sgt == NULL) {
> -		ret = -ENOMEM;
> -		goto error;
> -	}
> -
> -	ret = dma_get_sgtable(drm->dev, sgt, cma_obj->vaddr,
> -			      cma_obj->paddr, size);
> -	if (ret < 0)
> -		goto error;
> -
> -	cma_obj->sgt = sgt;
> -
>  	return cma_obj;
> 
>  error:
> -	kfree(sgt);
>  	drm_gem_cma_free_object(&cma_obj->base);
>  	return ERR_PTR(ret);
>  }
> @@ -175,10 +160,6 @@ void drm_gem_cma_free_object(struct drm_gem_object
> *gem_obj) if (cma_obj->vaddr) {
>  		dma_free_writecombine(gem_obj->dev->dev, cma_obj->base.size,
>  				      cma_obj->vaddr, cma_obj->paddr);
> -		if (cma_obj->sgt) {
> -			sg_free_table(cma_obj->sgt);
> -			kfree(cma_obj->sgt);
> -		}
>  	} else if (gem_obj->import_attach) {
>  		drm_prime_gem_destroy(gem_obj, cma_obj->sgt);
>  	}

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2014-03-15 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15  7:30 [PATCH] drm/cma: remove to make sg_table when gem cma is created Joonyoung Shim
2014-03-15 10:51 ` Laurent Pinchart [this message]

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=1597993.bKFS5RgF3j@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jy0922.shim@samsung.com \
    /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