From patchwork Mon May 20 10:46:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 2591411 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 7ED6EDF2A2 for ; Mon, 20 May 2013 10:47:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31FAEE5D1C for ; Mon, 20 May 2013 03:47:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by gabe.freedesktop.org (Postfix) with ESMTP id AE760E5CE3 for ; Mon, 20 May 2013 03:47:10 -0700 (PDT) Received: by mail-lb0-f175.google.com with SMTP id v10so6259088lbd.6 for ; Mon, 20 May 2013 03:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=H5FUGEb3HsKQMp4I4KAUGxqO4l9Vct1vo1+D4QxNutE=; b=SzUNITOGB7+zvbPeA7pF18uhr0GN3TugJfPz3WhO1NoFRvBmD8zUEC/c94yzKNJIFf 9PRVJZ5DvIaMokfkE0kBpNl4DQ+ESLHdnYlpi9nAizGh/4Oagn4grSFmRJ+caeyFUzLF d5Oz+bHk04ItJH9vHiLCN7qjxsgMN8D0U9blsTAM9vCU7kV3/CU61uUqISCQnCxVFyXM p6SKydOAyKpou6o2yCJKvCq1JIr5L3Qy+8kBbTXgonJa+2bmMeUQfvlzv3dsKvgombee xu7VgVgnDcooO99ErPZiu+iq6MioYmiy7Pg5BRVtBBDwXqfKgsUHQeXXefC7vEwxz/om K2vA== X-Received: by 10.112.199.194 with SMTP id jm2mr26318832lbc.21.1369046829431; Mon, 20 May 2013 03:47:09 -0700 (PDT) Received: from patrik-1201HA.lan (h138n8-oer-a32.ias.bredband.telia.com. [2.248.103.138]) by mx.google.com with ESMTPSA id b8sm9812059lak.8.2013.05.20.03.47.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 May 2013 03:47:07 -0700 (PDT) From: Patrik Jakobsson To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/gma500: Add fb gtt offset to fb base Date: Mon, 20 May 2013 12:46:59 +0200 Message-Id: <1369046822-3657-1-git-send-email-patrik.r.jakobsson@gmail.com> X-Mailer: git-send-email 1.8.1.2 Cc: Holger Schurig X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Old code assumed framebuffer starts at base of stolen memory. Since the addition of hardware cursors, this might not be true anymore so add the gtt offset to the calculation. Reported-by: Holger Schurig Tested-by: Holger Schurig CC: Holger Schurig Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/gma500/framebuffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 1534e22..8b1b6d9 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -121,8 +121,8 @@ static int psbfb_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) unsigned long address; int ret; unsigned long pfn; - /* FIXME: assumes fb at stolen base which may not be true */ - unsigned long phys_addr = (unsigned long)dev_priv->stolen_base; + unsigned long phys_addr = (unsigned long)dev_priv->stolen_base + + psbfb->gtt->offset; page_num = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; address = (unsigned long)vmf->virtual_address - (vmf->pgoff << PAGE_SHIFT);