linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kurtz <djkurtz@chromium.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Inki Dae" <inki.dae@samsung.com>,
	"Siarhei Siamashka" <siarhei.siamashka@gmail.com>,
	"Günther Noack" <me@guenthernoack.de>,
	"Joonyoung Shim" <jy0922.shim@samsung.com>,
	"Seung-Woo Kim" <sw0312.kim@samsung.com>,
	"Kyungmin Park" <kyungmin.park@samsung.com>,
	"David Airlie" <airlied@linux.ie>,
	"DRI Development" <dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Linux Fbdev development list" <linux-fbdev@vger.kernel.org>
Subject: Re: [PATCH] drm/exynos/fbdev: set smem_len for fbdev
Date: Thu, 25 Sep 2014 18:07:02 +0800	[thread overview]
Message-ID: <CAGS+omD055Bk+czk5=SDMRu1g-HGZHBobgasKC9PjF80Ci-czA@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdUoh6+gDcZty76HJhcQcJvM5DyBiD4YrZGuAX9e+F32-w@mail.gmail.com>

On Thu, Sep 25, 2014 at 5:32 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Sun, Aug 24, 2014 at 4:50 PM, Daniel Kurtz <djkurtz@chromium.org> wrote:
>> Commit [0] stopped setting fix.smem_start and fix.smem_len when creating
>> the fbdev.
>>
>> [0] 2f1eab8d8ab59e799f7d51d62410b398607a7bc3
>>   drm/exynos/fbdev: don't set fix.smem/mmio_{start,len}
>>
>> However, smem_len is used by some userland applications to calculate the
>> size for mmap.  In particular, it is used by xf86-video-fbdev:
>>
>> http://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/fbdevhw/fbdevhw.c?id=xorg-server-1.15.99.903#n571
>>
>> So, let's restore setting the smem_len to unbreak things for these users.
>>
>> Note: we are still leaving smem_start set to 0.
>
> Doesn't this cause a system crash when userspace (e.g. fbtest) writes into
> the mmap()ed /dev/fb*, as the wrong MMIO region is mapped?

Do you see a crash during testing, or is your question hypothetical?

I don't think there will be one.  exynos's fbev defines its own
fb_ops.fb_mmap, which uses dma_mmap_attrs() to mmap the fb's gem
buffer, which was allocated by dma_alloc_attrs().  This bypasses the
code in drivers/video/fbmem.c:fb_mmap() that references
fix.smem_start.

But, perhaps I am missing something?

-Dan

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

  reply	other threads:[~2014-09-25 10:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-24 14:50 [PATCH] drm/exynos/fbdev: set smem_len for fbdev Daniel Kurtz
2014-08-24 21:18 ` Günther Noack
2014-09-25  9:32 ` Geert Uytterhoeven
2014-09-25 10:07   ` Daniel Kurtz [this message]
2014-09-25 10:14     ` Geert Uytterhoeven

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='CAGS+omD055Bk+czk5=SDMRu1g-HGZHBobgasKC9PjF80Ci-czA@mail.gmail.com' \
    --to=djkurtz@chromium.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=inki.dae@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@guenthernoack.de \
    --cc=siarhei.siamashka@gmail.com \
    --cc=sw0312.kim@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;
as well as URLs for NNTP newsgroup(s).