From patchwork Fri Apr 4 09:22:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 3937401 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA4CBBFF02 for ; Fri, 4 Apr 2014 09:22:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14E7A20381 for ; Fri, 4 Apr 2014 09:22:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 345E520374 for ; Fri, 4 Apr 2014 09:22:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEB116E048; Fri, 4 Apr 2014 02:22:16 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 72EF96E048 for ; Fri, 4 Apr 2014 02:22:15 -0700 (PDT) Received: by mail-pd0-f182.google.com with SMTP id y10so3092977pdj.27 for ; Fri, 04 Apr 2014 02:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=TKy9dPO7rBNmc30hLsM8cziz4R3DIaY3CH2xI15EJv4=; b=K3hbrWAq7KHejvBoa4XHlEAU14cRIvPiA4LOyuYyX0mEURa7cLq7ukmXiR4geTSlPL pU/Rw6YkCz8yZy6KFBE8A1rF1jCQc1mo71JrIRbtlssp9CMmDU0EJCAUuSe0On01i1cJ ZwJSkgyEam6UflalnrIwEGBQM9+yXC0w16ao8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TKy9dPO7rBNmc30hLsM8cziz4R3DIaY3CH2xI15EJv4=; b=RldWYaz2vO86VtjxX0T8K6UDwduhYTcpO+J95yZTRwZy9a7RqTHd0BVWZP7AtebcLs RJ1pab4iQjX1uodUxlnAkOqp8W6iAUnSAVMFBN/4BXSLO7Mpr2kGnyakadqhWutM29W4 XiWIfl9II+6FYCsmwgs23wrp0zIx0f/oyh05SLycR3FXAjoR3z/utagBTKPTr4e0RIAu v+0OYT0Ixr9wxjNOhrbGeX/gNSCIIfWx+YsOmtkn1cNrMEuDIRLIvTzmv97DPoY0QuIG RTuAu0KkBriTTeM9Lq7gYh/JSiOliHAU7ErgbFWNE8ddGSgccZDWHxOByVbn8m0IjHtw eNuQ== X-Gm-Message-State: ALoCoQmspWK/1znFg5ep7CKcBHSVFr0Gr5bPVp7zfiRGrG5ix9GXLFTgPEjQuKSlp1Vb3aFpP2Fj X-Received: by 10.68.134.169 with SMTP id pl9mr13474096pbb.133.1396603335187; Fri, 04 Apr 2014 02:22:15 -0700 (PDT) Received: from djkurtzt530-glaptop.hitronhub.home (123-193-35-201.dynamic.kbronet.com.tw. [123.193.35.201]) by mx.google.com with ESMTPSA id kc9sm16484867pbc.25.2014.04.04.02.22.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 02:22:13 -0700 (PDT) From: Daniel Kurtz To: Inki Dae , dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/exynos/fbdev: don't set fix.smem/mmio_{start,len} Date: Fri, 4 Apr 2014 17:22:01 +0800 Message-Id: <1396603322-13585-1-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a Cc: Kukjin Kim , Seung-Woo Kim , linux-kernel@vger.kernel.org, Kyungmin Park , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; return 0; }