All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Aaron Plattner <aplattner@nvidia.com>
Cc: "laurent.pinchart@ideasonboard.com"
	<laurent.pinchart@ideasonboard.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/3] drm: add mmap function to prime helpers
Date: Mon, 17 Jun 2013 11:02:32 +0900	[thread overview]
Message-ID: <51BE6E38.70902@samsung.com> (raw)
In-Reply-To: <51BB4FD5.7000401@nvidia.com>

On 06/15/2013 02:16 AM, Aaron Plattner wrote:
> On 06/12/2013 06:16 AM, Joonyoung Shim wrote:
>> This adds to call low-level mmap() from prime helpers.
>>
>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>> ---
>>   drivers/gpu/drm/drm_prime.c | 5 ++++-
>>   include/drm/drmP.h          | 2 ++
>>   2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
>> index d92853e..3a008b2 100644
>> --- a/drivers/gpu/drm/drm_prime.c
>> +++ b/drivers/gpu/drm/drm_prime.c
>> @@ -165,7 +165,10 @@ static void drm_gem_dmabuf_kunmap(struct dma_buf 
>> *dma_buf,
>>   static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf,
>>           struct vm_area_struct *vma)
>>   {
>> -    return -EINVAL;
>> +    struct drm_gem_object *obj = dma_buf->priv;
>> +    struct drm_device *dev = obj->dev;
>> +
>> +    return dev->driver->gem_prime_mmap(obj, vma);
>
> Won't this crash if the driver doesn't fill in the new field and 
> userspace tries to map it?
>

Right, if gem_prime_mmap field is NULL, should return error.

Thanks for comments.

      reply	other threads:[~2013-06-17  2:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 13:16 [PATCH 1/3] drm: add mmap function to prime helpers Joonyoung Shim
2013-06-12 13:16 ` [PATCH 2/3] drm/cma: add low-level hook functions to use " Joonyoung Shim
2013-06-12 13:16 ` [PATCH 3/3] drm/cma: remove GEM CMA specific dma_buf functionality Joonyoung Shim
2013-06-14 17:16 ` [PATCH 1/3] drm: add mmap function to prime helpers Aaron Plattner
2013-06-17  2:02   ` Joonyoung Shim [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=51BE6E38.70902@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=aplattner@nvidia.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.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 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.