NetBSD Problem Report #54808

From abs@forsaken.absd.org  Sun Dec 29 15:51:20 2019
Return-Path: <abs@forsaken.absd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 50E307A16D
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 29 Dec 2019 15:51:20 +0000 (UTC)
Message-Id: <20191229143145.DC2F61F5975@forsaken.absd.org>
Date: Sun, 29 Dec 2019 14:31:45 +0000 (GMT)
From: abs@absd.org
Reply-To: abs@absd.org
To: gnats-bugs@NetBSD.org
Subject: Visual artifacts in Firefox after bus_space changes
X-Send-Pr-Version: 3.95

>Number:         54808
>Category:       port-amd64
>Synopsis:       Visual artifacts in Firefox after bus_space changes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 29 15:55:00 +0000 2019
>Last-Modified:  Mon Feb 10 21:55:01 +0000 2020
>Originator:     abs@absd.org
>Release:        NetBSD 9.0_RC1
>Organization:

>Environment:
System: NetBSD forsaken.absd.org 9.0_RC1 NetBSD 9.0_RC1 (GENERIC_DIAGNOSTIC) #2: Sat Dec 28 15:13:18 GMT 2019 abs@iris.absd.org:/opt/netbsd/9/sys/arch/amd64/compile/GENERIC_DIAGNOSTIC amd64
Architecture: x86_64
Machine: amd64
>Description:
        After pullup of http://releng.netbsd.org/cgi-bin/req-9.cgi?show=566 
        ( src/sys/arch/x86/x86/bus_space.c 1.42 & 1.43)
        visual artifacts are observed in Firefox. 

        Its as if a partial screen update can happen, when drawing a new
        character when typing (eg into gmail or slack), highlighting some text
        or even updating a screen element on hover. Its quickly replaced with
        the correct content.

        Its sometimes quite subtle, and occasionally very unsubtle.

        Two quick videos indicating the issue

        https://photos.google.com/share/AF1QipNaEbA8nrfrK1EpGqvOVjt_hLMtThJQTV_z7XWqlOExJGHsaktPi8V9qxEOW0zi5Q?key=VkV1YkVabHh3TVFwLUJsQTlGMUIxWWNBSndUb01R

        This is on a Thinkpad T480
        i915drmkms0 at pci0 dev 2 function 0: Intel UHD Graphics 620 (GT2) (rev. 0x07)
        intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20151010

>How-To-Repeat:
         All tests with GENERIC+DIAGNOSTIC:
         - latest netbsd-9 as of 2019-09-27 - issue seen
         - revert pullup of sys/arch/x86/x86/bus_space.c r1.43 - issue seen
         - also revert pullup of sys/arch/x86/x86/bus_space.c r1.42 - issue no
         longer seen

	Its *possible* that I may have seen it once with r1.43 & r1.42
        reverted - which could imply its a x11/drm issue which the better
        barrier enforcement is making more visible. Will keep running with
        GENERIC+DIAGNOSTIC plus the reversion to see if I see it again
>Fix:


>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-amd64/54808: Visual artifacts in Firefox after bus_space
 changes
Date: Sun, 29 Dec 2019 19:04:21 +0000

 I see some cases where the cache behaviour of memory for NetBSD differs
 from the upstream, linux ones. I wonder if it can help to make them
 match.

 sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c


 #ifdef __NetBSD__ ... write-combining
 	err = -bus_space_map(opregion->bst, asls, OPREGION_SIZE,
 		    BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE, &opregion->bsh);

 #else
 	base = memremap(asls, OPREGION_SIZE, MEMREMAP_WB);
 #endif

 jared states an equivalent to MEMREMAP_WB is BUS_SPACE_MAP_CACHEABLE.

From: David Brownlee <abs@absd.org>
To: gnats-bugs@netbsd.org
Cc: port-amd64-maintainer@netbsd.org, gnats-admin@netbsd.org, 
	netbsd-bugs@netbsd.org
Subject: Re: port-amd64/54808: Visual artifacts in Firefox after bus_space changes
Date: Sun, 29 Dec 2019 20:46:36 +0000

 Well I've just booted a netbsd-9 kernel with BUS_SPACE_MAP_CACHEABLE
 instead of BUS_SPACE_MAP_PREFETCHABLE and no other changes apart from
 +DIAGNOSTIC (so the bus_space as-is on netbsd-9), and its looking
 good...

 Thanks

 David

 On Sun, 29 Dec 2019 at 19:05, <coypu@sdf.org> wrote:
 >
 > The following reply was made to PR port-amd64/54808; it has been noted by GNATS.
 >
 > From: coypu@sdf.org
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: port-amd64/54808: Visual artifacts in Firefox after bus_space
 >  changes
 > Date: Sun, 29 Dec 2019 19:04:21 +0000
 >
 >  I see some cases where the cache behaviour of memory for NetBSD differs
 >  from the upstream, linux ones. I wonder if it can help to make them
 >  match.
 >
 >  sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c
 >
 >
 >  #ifdef __NetBSD__ ... write-combining
 >         err = -bus_space_map(opregion->bst, asls, OPREGION_SIZE,
 >                     BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE, &opregion->bsh);
 >
 >  #else
 >         base = memremap(asls, OPREGION_SIZE, MEMREMAP_WB);
 >  #endif
 >
 >  jared states an equivalent to MEMREMAP_WB is BUS_SPACE_MAP_CACHEABLE.
 >

From: David Brownlee <abs@absd.org>
To: gnats-bugs@netbsd.org
Cc: port-amd64-maintainer@netbsd.org, gnats-admin@netbsd.org, 
	netbsd-bugs@netbsd.org
Subject: Re: port-amd64/54808: Visual artifacts in Firefox after bus_space changes
Date: Sun, 29 Dec 2019 21:08:12 +0000

 On Sun, 29 Dec 2019 at 20:46, David Brownlee <abs@absd.org> wrote:
 >
 > Well I've just booted a netbsd-9 kernel with BUS_SPACE_MAP_CACHEABLE
 > instead of BUS_SPACE_MAP_PREFETCHABLE and no other changes apart from
 > +DIAGNOSTIC (so the bus_space as-is on netbsd-9), and its looking
 > good...

 Damn.. spoke to soon - issue came back, so is still present with this change

 Thanks

 David

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54808 CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Date: Mon, 10 Feb 2020 21:54:26 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Mon Feb 10 21:54:26 UTC 2020

 Modified Files:
 	src/sys/external/bsd/drm2/dist/drm/i915: intel_opregion.c

 Log Message:
 Use a closer equivalent to MEMREMAP_WB: BUS_SPACE_MAP_CACHEABLE

 Not a fix for PR port-amd64/54808


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.15 \
     src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.