linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: siarhei.siamashka@gmail.com (Siarhei Siamashka)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] drm/exynos/fbdev: don't set fix.smem/mmio_{start,len}
Date: Fri, 20 Jun 2014 02:59:38 +0300	[thread overview]
Message-ID: <20140620025938.2e80efa0@i7> (raw)
In-Reply-To: <1396603322-13585-1-git-send-email-djkurtz@chromium.org>

On Fri,  4 Apr 2014 17:22:01 +0800
Daniel Kurtz <djkurtz@chromium.org> wrote:

> Kernel access to the eyxnos fbdev framebuffer is via its gem object's
> kernel mapping (kvaddr, stored in info->screen_base).
> 
> User space access is provided by mmap(), read() and write() of /dev/fb/fb0.
> These functions also only use screen_base/screen_size().
> 
> Therefore, it is not necessary to set fix->smem_{start,len} or
> fix->mmio_{start,len} fields.
> 
> This avoids leaking kernel, physical and dma mapped addresses to user
> space via the ioctls FBIOGET_VSCREENINFO and FBIOGET_FSCREENINFO.
> 
> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> index 5fa342e..2dcc589 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> @@ -123,14 +123,7 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
>  
>  	dev->mode_config.fb_base = (resource_size_t)buffer->dma_addr;
>  	fbi->screen_base = buffer->kvaddr + offset;
> -	if (is_drm_iommu_supported(dev))
> -		fbi->fix.smem_start = (unsigned long)
> -			(page_to_phys(sg_page(buffer->sgt->sgl)) + offset);
> -	else
> -		fbi->fix.smem_start = (unsigned long)buffer->dma_addr;
> -
>  	fbi->screen_size = size;
> -	fbi->fix.smem_len = size;

Can we keep proper initialization of 'smem_len'? Some userland
applications use it for calculating the size for mmap:

    http://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/fbdevhw/fbdevhw.c?id=xorg-server-1.15.99.903#n571

>  
>  	return 0;
>  }

Basically, this patch breaks the xf86-video-fbdev ddx and some users
are already unhappy.

-- 
Best regards,
Siarhei Siamashka

  parent reply	other threads:[~2014-06-19 23:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  9:22 [PATCH 1/2] drm/exynos/fbdev: don't set fix.smem/mmio_{start,len} Daniel Kurtz
2014-04-04  9:22 ` [PATCH 2/2] drm/exynos/fbdev: don't set mode_config.fb_base Daniel Kurtz
2014-06-19 23:59 ` Siarhei Siamashka [this message]
2014-06-20 12:15   ` [PATCH 1/2] drm/exynos/fbdev: don't set fix.smem/mmio_{start, len} Daniel Kurtz

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=20140620025938.2e80efa0@i7 \
    --to=siarhei.siamashka@gmail.com \
    --cc=linux-arm-kernel@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 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).