All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: Heiko Stuebner <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/rockchip: unset pgoff when mmap'ing gems
Date: Tue, 10 Nov 2015 13:53:44 +0800	[thread overview]
Message-ID: <56418668.8080306@rock-chips.com> (raw)
In-Reply-To: <2793929.5WVauesvFQ@phil>

On 2015年11月10日 03:52, Heiko Stuebner wrote:
> Commit 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check
>   in dma_mmap()") introduced offset-checking for mappings, which collides
> with the fake-offset the drm sets for gems.
>
> Other drm-drivers set this offset to 0 before doing the mapping, so
> this looks like the correct way to go for rockchip as well.
>
> Fixes: 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check in dma_mmap()")
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> This patch is definitly necessary to keep the rockchip-drm working
> with kernel 4.4.
>
>   drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> index e50d113..e9bc188 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> @@ -68,6 +68,7 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
>   	 * VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap().
>   	 */
>   	vma->vm_flags &= ~VM_PFNMAP;
> +	vma->vm_pgoff = 0;
>   
>   	ret = dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr,
>   			     obj->size, &rk_obj->dma_attrs);
Hi Heiko
      Sorry for miss this patch, thanks for the fix.
      Acked-by: Mark Yao <mark.yao@rock-chips.com>

-- 
Mark Yao


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

WARNING: multiple messages have this Message-ID (diff)
From: mark.yao@rock-chips.com (Mark yao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] drm/rockchip: unset pgoff when mmap'ing gems
Date: Tue, 10 Nov 2015 13:53:44 +0800	[thread overview]
Message-ID: <56418668.8080306@rock-chips.com> (raw)
In-Reply-To: <2793929.5WVauesvFQ@phil>

On 2015?11?10? 03:52, Heiko Stuebner wrote:
> Commit 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check
>   in dma_mmap()") introduced offset-checking for mappings, which collides
> with the fake-offset the drm sets for gems.
>
> Other drm-drivers set this offset to 0 before doing the mapping, so
> this looks like the correct way to go for rockchip as well.
>
> Fixes: 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check in dma_mmap()")
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> This patch is definitly necessary to keep the rockchip-drm working
> with kernel 4.4.
>
>   drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> index e50d113..e9bc188 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> @@ -68,6 +68,7 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
>   	 * VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap().
>   	 */
>   	vma->vm_flags &= ~VM_PFNMAP;
> +	vma->vm_pgoff = 0;
>   
>   	ret = dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr,
>   			     obj->size, &rk_obj->dma_attrs);
Hi Heiko
      Sorry for miss this patch, thanks for the fix.
      Acked-by: Mark Yao <mark.yao@rock-chips.com>

-- 
?ark Yao

  reply	other threads:[~2015-11-10  5:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09 19:50 [PATCH 1/2] drm/rockchip: create the fake mmap offset during gem creation Heiko Stuebner
2015-11-09 19:50 ` Heiko Stuebner
2015-11-09 19:52 ` [PATCH 2/2] drm/rockchip: unset pgoff when mmap'ing gems Heiko Stuebner
2015-11-09 19:52   ` Heiko Stuebner
2015-11-10  5:53   ` Mark yao [this message]
2015-11-10  5:53     ` Mark yao
2015-11-10  6:17 ` [PATCH 1/2] drm/rockchip: create the fake mmap offset during gem creation Mark yao
2015-11-10  6:17   ` Mark yao
2015-11-10  6:46   ` Heiko Stuebner
2015-11-10  6:46     ` Heiko Stuebner
2015-11-10  9:26     ` Mark yao
2015-11-10  9:26       ` Mark yao
2015-11-10  9:28       ` Heiko Stuebner
2015-11-10  9:28         ` Heiko Stuebner
2015-11-10  9:38         ` Mark yao
2015-11-10  9:38           ` Mark yao
2015-11-16 16:21   ` Daniel Vetter
2015-11-16 16:21     ` Daniel Vetter

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=56418668.8080306@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.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.