From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757518AbcCXQtL (ORCPT ); Thu, 24 Mar 2016 12:49:11 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:43298 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757070AbcCXQs7 (ORCPT ); Thu, 24 Mar 2016 12:48:59 -0400 From: Alexey Brodkin To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Alexey Brodkin , linux-snps-arc@lists.infradead.org Subject: [PATCH 4/5 v4] arc: Add our own implementation of fb_pgprotect() Date: Thu, 24 Mar 2016 19:48:35 +0300 Message-Id: <1458838116-24954-5-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458838116-24954-1-git-send-email-abrodkin@synopsys.com> References: <1458838116-24954-1-git-send-email-abrodkin@synopsys.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During mmaping of frame-buffer pages to user-space fb_protect() is called to set proper page settings. In case of ARC we need to mark pages that are mmaped to user as uncached because of 2 reasons: * Huge amount of data if passing through data cache will thrash cache a lot making cache almost useless for other less traffic hungry processes. * Data written by user in FB will be immediately available for hardware (such as PGU etc) without requirements to flush data cache regularly. Signed-off-by: Alexey Brodkin Cc: linux-snps-arc@lists.infradead.org --- Changes v3 -> v4: * This change was introduced only in v4. arch/arc/include/asm/fb.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 arch/arc/include/asm/fb.h diff --git a/arch/arc/include/asm/fb.h b/arch/arc/include/asm/fb.h new file mode 100644 index 0000000..bd3f68c --- /dev/null +++ b/arch/arc/include/asm/fb.h @@ -0,0 +1,19 @@ +#ifndef _ASM_FB_H_ +#define _ASM_FB_H_ + +#include +#include +#include + +static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, + unsigned long off) +{ + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); +} + +static inline int fb_is_primary_device(struct fb_info *info) +{ + return 0; +} + +#endif /* _ASM_FB_H_ */ -- 2.5.0