From patchwork Tue Jan 29 15:04:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Andrushchenko X-Patchwork-Id: 10786477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 409F3139A for ; Tue, 29 Jan 2019 15:04:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AF052C99F for ; Tue, 29 Jan 2019 15:04:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E6512C9A2; Tue, 29 Jan 2019 15:04:35 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1EF8E2C986 for ; Tue, 29 Jan 2019 15:04:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 087516E32D; Tue, 29 Jan 2019 15:04:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id C16166E32D for ; Tue, 29 Jan 2019 15:04:31 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id n18-v6so17746962lji.7 for ; Tue, 29 Jan 2019 07:04:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MXMFISiPlkQDpdZA8bK8+pzyO4DsYsihlwnDgdehNwA=; b=JgbFsq1XNYtSU4HFlRsYWHQErZGPHZ2xTjJGB6YfwhUq7e61dZH5g1rR6RnuVSVq1c 6AHHxPilYWTaMlB7D4GspzxRCkzS0TZSWLLz479r/aTeG6rdBuFqSS/Ivkkz2ApTGXXf R7SLYvkShBMfUsqC8+JULLCmvrlL1pmqFrhhPdwFrhCJKCZiyFCqjKwHMv6iUSHFNSQw 88Paw5xOeU7OZbvvXt1lQ5NeycpocOaH8iSPCKCbn0FK5CrRKwl42K06KGYQv+vCgCxe Ss9t/UEVZZMw+WhzQv49o2//zCGNvhvlNO5z31vteWhmceC/cOzYH6Cd6l6zT4YznXZ3 GQGw== X-Gm-Message-State: AJcUukdU2BdFwXTTbGMKO08HGS7KVZ8VZWXi1apJASKrgYpt+cvC8lc2 kgHPlKBhxKEraANgNomFD2Q= X-Google-Smtp-Source: ALg8bN6GRRWmTBU/Selfj+MJOLMb0wxXtyiGI+Nk4o7ydFetDWUoFcC18j1fyeY/W5SykWAWtxnTcg== X-Received: by 2002:a2e:86ca:: with SMTP id n10-v6mr18841740ljj.49.1548774269897; Tue, 29 Jan 2019 07:04:29 -0800 (PST) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-22.209.223.85.sovam.net.ua. [85.223.209.22]) by smtp.gmail.com with ESMTPSA id r29-v6sm3535027ljd.44.2019.01.29.07.04.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Jan 2019 07:04:29 -0800 (PST) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, daniel.vetter@intel.com, jgross@suse.com, boris.ostrovsky@oracle.com, kraxel@redhat.com, noralf@tronnes.org, hch@infradead.org, julien.grall@arm.com Subject: [Xen-devel][PATCH] drm/xen-front: Fix mmap attributes for display buffers Date: Tue, 29 Jan 2019 17:04:22 +0200 Message-Id: <20190129150422.19867-1-andr2000@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andr2000@gmail.com, Oleksandr Andrushchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Oleksandr Andrushchenko When GEM backing storage is allocated those are normal pages, so there is no point using pgprot_writecombine while mmaping. This fixes mismatch of buffer pages' memory attributes between the frontend and backend which may cause screen artifacts. Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Oleksandr Andrushchenko Suggested-by: Julien Grall Acked-by: Julien Grall --- drivers/gpu/drm/xen/xen_drm_front_gem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c index d303a2e17f5e..9d5c03d7668d 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c @@ -235,8 +235,7 @@ static int gem_mmap_obj(struct xen_gem_object *xen_obj, vma->vm_flags &= ~VM_PFNMAP; vma->vm_flags |= VM_MIXEDMAP; vma->vm_pgoff = 0; - vma->vm_page_prot = - pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); /* * vm_operations_struct.fault handler will be called if CPU access @@ -283,7 +282,7 @@ void *xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj) return NULL; return vmap(xen_obj->pages, xen_obj->num_pages, - VM_MAP, pgprot_writecombine(PAGE_KERNEL)); + VM_MAP, PAGE_KERNEL); } void xen_drm_front_gem_prime_vunmap(struct drm_gem_object *gem_obj,