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: 3937461 Return-Path: X-Original-To: patchwork-linux-arm@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 60EC5C0DA2 for ; Fri, 4 Apr 2014 09:23:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F98A203C4 for ; Fri, 4 Apr 2014 09:22:59 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9931720381 for ; Fri, 4 Apr 2014 09:22:58 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WW0Kn-0005yY-9D; Fri, 04 Apr 2014 09:22:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WW0Kk-0003RT-El; Fri, 04 Apr 2014 09:22:46 +0000 Received: from mail-pb0-x236.google.com ([2607:f8b0:400e:c01::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WW0Kg-0003PY-HY for linux-arm-kernel@lists.infradead.org; Fri, 04 Apr 2014 09:22:43 +0000 Received: by mail-pb0-f54.google.com with SMTP id ma3so3197180pbc.13 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=XbPcV1mbJVABUrXoZgt6uFcneuRwAkfnY/x/ADtcja59oNqrfq54KufHg02YkFDRjL 2z1UN87hrDcELGoZXKdjpYxboRDk2U/7vYGq8TIbfo1aum4pqHpay5OK3cK+vfl3t4UT ZoAwc2WcjGqCRYVC0dfQLltjtxqxr3miQIyMbt34b1eJ6FPWSJJ8eehzvAThLnjSZIoU oDbbE4V0M3tf0fk4uKyFGMo459I69zN1xrF5yQZVjEaE0MSX9AyiP4zPPPctuikfBRdh BEjQZ00mz4TVkW8ayg5MpDqYixHniIN17vNeQhSwxJGh7D5NE8fE3+6jqI0u4rSQksdi 0e5w== X-Gm-Message-State: ALoCoQkKkQmdFHK2Sec+gPzDVUNsY/ZOwZdVoR3I3dYx+eBHAC76xOJud5KfQjRu2B/qiJgMQMuE 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140404_052242_690613_B1D54FD7 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) Cc: Kukjin Kim , Joonyoung Shim , David Airlie , Seung-Woo Kim , linux-kernel@vger.kernel.org, Daniel Kurtz , Kyungmin Park , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=unavailable 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; }