From owner-svn-src-head@freebsd.org Sat Oct 1 18:16:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72DB2A9408F; Sat, 1 Oct 2016 18:16:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D033E6; Sat, 1 Oct 2016 18:16:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u91Hh2Ui034405; Sat, 1 Oct 2016 17:43:02 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u91Hh2Kq034403; Sat, 1 Oct 2016 17:43:02 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610011743.u91Hh2Kq034403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 1 Oct 2016 17:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306555 - in head/sys: dev/fb sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2016 18:16:24 -0000 Author: gonzo Date: Sat Oct 1 17:43:02 2016 New Revision: 306555 URL: https://svnweb.freebsd.org/changeset/base/306555 Log: Provide way for framebuffer driver to request mmap(2) mapping type On ARM if memattr is not overriden mmap(2) maps framebuffer memory as WBWA which means part of changes to content in userland end up in cache and appear on screen gradually as cache lines are evicted. This change adds configurable memattr that hardware fb implementation can set to get the memory mapping type it requires: - Add new flag FB_FLAG_MEMATTR that indicates that framebuffer driver overrides default memattr - Add new field fb_memattr to struct fb_info to specify requested memattr Reviewed by: ray Differential Revision: https://reviews.freebsd.org/D8064 Modified: head/sys/dev/fb/fbd.c head/sys/sys/fbio.h Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Sat Oct 1 11:43:37 2016 (r306554) +++ head/sys/dev/fb/fbd.c Sat Oct 1 17:43:02 2016 (r306555) @@ -178,6 +178,8 @@ fb_mmap(struct cdev *dev, vm_ooffset_t o *paddr = vtophys((uint8_t *)info->fb_vbase + offset); else *paddr = info->fb_pbase + offset; + if (info->fb_flags & FB_FLAG_MEMATTR) + *memattr = info->fb_memattr; return (0); } return (EINVAL); Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Sat Oct 1 11:43:37 2016 (r306554) +++ head/sys/sys/fbio.h Sat Oct 1 17:43:02 2016 (r306555) @@ -142,6 +142,8 @@ struct fb_info { uint32_t fb_flags; #define FB_FLAG_NOMMAP 1 /* mmap unsupported. */ #define FB_FLAG_NOWRITE 2 /* disable writes for the time being */ +#define FB_FLAG_MEMATTR 4 /* override memattr for mmap */ + vm_memattr_t fb_memattr; int fb_stride; int fb_bpp; /* bits per pixel */ uint32_t fb_cmap[16];