dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Ziswiler <marcel.ziswiler-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>
To: "thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "stefan-XLVq0VzYD2Y@public.gmane.org"
	<stefan-XLVq0VzYD2Y@public.gmane.org>,
	"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 3/3] drm/tegra: fb: Implement ->fb_mmap() callback
Date: Thu, 8 Feb 2018 00:52:15 +0000	[thread overview]
Message-ID: <1518051133.3701.93.camel@toradex.com> (raw)
In-Reply-To: <20180207174556.25401-3-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Wed, 2018-02-07 at 18:45 +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> This fixes hangs with legacy applications that use the mmap() syscall
> on
> the fbdev device to map framebuffer memory. The fbdev implementation
> for
> mmap() creates a mapping that conflicts with DRM usage and causes a
> hang
> when the memory is accessed through the mapping.

With that legacy Qt4e applications run just fine now on Apalis TK1
running Linux kernel 4.14.18.

Thanks, Thierry!

Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

Reported-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpu/drm/tegra/fb.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
> index 001cb77e2f59..0786159edef3 100644
> --- a/drivers/gpu/drm/tegra/fb.c
> +++ b/drivers/gpu/drm/tegra/fb.c
> @@ -224,12 +224,28 @@ struct drm_framebuffer *tegra_fb_create(struct
> drm_device *drm,
>  }
>  
>  #ifdef CONFIG_DRM_FBDEV_EMULATION
> +static int tegra_fb_mmap(struct fb_info *info, struct vm_area_struct
> *vma)
> +{
> +	struct drm_fb_helper *helper = info->par;
> +	struct tegra_bo *bo;
> +	int err;
> +
> +	bo = tegra_fb_get_plane(helper->fb, 0);
> +
> +	err = drm_gem_mmap_obj(&bo->gem, bo->gem.size, vma);
> +	if (err < 0)
> +		return err;
> +
> +	return __tegra_gem_mmap(&bo->gem, vma);
> +}
> +
>  static struct fb_ops tegra_fb_ops = {
>  	.owner = THIS_MODULE,
>  	DRM_FB_HELPER_DEFAULT_OPS,
>  	.fb_fillrect = drm_fb_helper_sys_fillrect,
>  	.fb_copyarea = drm_fb_helper_sys_copyarea,
>  	.fb_imageblit = drm_fb_helper_sys_imageblit,
> +	.fb_mmap = tegra_fb_mmap,
>  };
>  
>  static int tegra_fbdev_probe(struct drm_fb_helper *helper,

      parent reply	other threads:[~2018-02-08  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 17:45 [PATCH 1/3] drm/tegra: gem: Reshuffle declarations Thierry Reding
     [not found] ` <20180207174556.25401-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-07 17:45   ` [PATCH 2/3] drm/tegra: gem: Make __tegra_gem_mmap() available more widely Thierry Reding
2018-02-07 17:45   ` [PATCH 3/3] drm/tegra: fb: Implement ->fb_mmap() callback Thierry Reding
2018-02-07 19:24     ` stefan
     [not found]     ` <20180207174556.25401-3-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-08  0:52       ` Marcel Ziswiler [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=1518051133.3701.93.camel@toradex.com \
    --to=marcel.ziswiler-2kbjvhiyjgbbdgjk7y7tuq@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stefan-XLVq0VzYD2Y@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox