From patchwork Sat May 21 13:21:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Falak R Wani X-Patchwork-Id: 9130597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D8D26048B for ; Sat, 21 May 2016 16:03:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52C3C27F17 for ; Sat, 21 May 2016 16:03:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47E8228114; Sat, 21 May 2016 16:03:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16DC927F17 for ; Sat, 21 May 2016 16:03:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1068C6E38E; Sat, 21 May 2016 16:03:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80D4A6E1BE for ; Sat, 21 May 2016 13:21:33 +0000 (UTC) Received: by mail-pa0-x241.google.com with SMTP id f8so1596311pag.0 for ; Sat, 21 May 2016 06:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=qZUqfWnjUb5vzNDKWhDsCE37BxQAdVVAJ7mFGGdNt7Y=; b=avzJuN2j6L2Y033Puo4u5PLLc2BEgUmnOFhVFJnoqKtkBA0UVLlxsumTwBI0D+iMpo KWB5e1DG7x16iStMx/TJR8MBaQ/9KFPeALiOsFwOJOolYsXCii7x+W1nLGNSbkA1I8VH sUo6UzE8pIC45AoxZV3+880FKWqbf6s4zXam00gbfUNNaAEgU/kR3a+p1L750ePMPL8z 7EVJdE8VgjpHSXkTwOFevisiB16iQ7eM3NdJAZZ8DDaffWJI6W2+dzNPxDwglzHLxIdx lbj6eHAfBkPpvNPSWF2sHihKXNEkjl6QMB7MceiRfbgJK5/I8z0cHGgzSbOLfXXplHh9 LocQ== 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=qZUqfWnjUb5vzNDKWhDsCE37BxQAdVVAJ7mFGGdNt7Y=; b=K3ylccVLVw24jxznQiPUjneAj5sPK3SsHD+PO7tFZ1yTnEeOJ8ShL5ZxKnAZcEHL4l xMtL4a7RfFVz4TtYTh5I9SMHI7gWnAxoxkXXPx2TOG4H3mMI1S4yWhuUixKJhuEJygVM Nuaq4eLgfNCWCtcihJd/tgs7spbNs7/ZS628BWBjsAhOi/OmX88eMnp3bCJyOKCYphf4 1VBN0aa1p4Fgu1KFkyJOobCt+rGVPr0+8P3xhL/BM1GgB2Ym7tMSi3azk0ikONXtCw0/ VPyv61of+sp6oTrJ+76VN1JPMlwrC+t/8ZOa3MDSwKmSPsKmaVjgre2is4+GNlnRjBs4 3wFg== X-Gm-Message-State: AOPr4FVFH98aeMTyhOq1obRtlyNaSfULYx3SHC59efdazhro+1xyDY8Y3j5Rjc8pl88a6Q== X-Received: by 10.66.123.37 with SMTP id lx5mr12822726pab.101.1463836892881; Sat, 21 May 2016 06:21:32 -0700 (PDT) Received: from kp.domain.name ([110.235.28.83]) by smtp.gmail.com with ESMTPSA id lg17sm25088906pab.36.2016.05.21.06.21.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 21 May 2016 06:21:32 -0700 (PDT) From: Muhammad Falak R Wani To: Patrik Jakobsson Subject: [PATCH] drm/gma500: use vma_pages(). Date: Sat, 21 May 2016 18:51:01 +0530 Message-Id: <1463836880-16878-1-git-send-email-falakreyaz@gmail.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Sat, 21 May 2016 16:03:10 +0000 Cc: open list , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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-Virus-Scanned: ClamAV using ClamSMTP Replace explicit computation of vma page count by a call to vma_pages() Signed-off-by: Muhammad Falak R Wani --- drivers/gpu/drm/gma500/framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 7440bf9..5486e7e 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -125,7 +125,7 @@ static int psbfb_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) unsigned long phys_addr = (unsigned long)dev_priv->stolen_base + psbfb->gtt->offset; - page_num = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + page_num = vma_pages(vma); address = (unsigned long)vmf->virtual_address - (vmf->pgoff << PAGE_SHIFT); vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);