From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: Patches for i830 flicker on panning Date: Tue, 5 Nov 2013 08:07:14 +0100 Message-ID: <20131105070714.GS4167@phenom.ffwll.local> References: <52768009.7070905@math.tu-berlin.de> <20131103171208.GA4167@phenom.ffwll.local> <19544_1383498802_52768431_19544_2610_1_20131103171348.GB4167@phenom.ffwll.local> <52769D39.5070501@math.tu-berlin.de> <19544_1383513468_5276BD7B_19544_3653_1_20131103211814.GC4167@phenom.ffwll.local> <5276D7BA.4090401@math.tu-berlin.de> <19544_1383549334_52774996_19544_5502_1_CAKMK7uEPjjCsqYTpyO+Bes1eg5b8fVfGFkzQFtwDPxYNe4KwRw@mail.gmail.com> <52778BA0.90604@math.tu-berlin.de> <19544_1383578084_5277B9E4_19544_9350_1_20131104151509.GF4167@phenom.ffwll.local> <52782BDA.5030100@math.tu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B08EEED68 for ; Mon, 4 Nov 2013 23:06:47 -0800 (PST) Received: by mail-ea0-f172.google.com with SMTP id r16so3939814ead.17 for ; Mon, 04 Nov 2013 23:06:45 -0800 (PST) Content-Disposition: inline In-Reply-To: <52782BDA.5030100@math.tu-berlin.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Thomas Richter Cc: intel-gfx List-Id: intel-gfx@lists.freedesktop.org On Tue, Nov 05, 2013 at 12:20:58AM +0100, Thomas Richter wrote: > Hi Daniel, dear intel experts, > > the following is a "solution" for the flicker on i830 panning. To > remind you, when panning is enabled on an i830, > the display shows an annoying 30Hz flicker on some "forbidden" > positions. On such positions, half of the frames > is black, and the other half shows a screen that is "ripped in > half", with one half scrolled to the wrong > position, and the other half displayed correctly, with a > discontinuity in the middle. > That is, every other frame is black, and the ones that are not black > are "wrong". > > The patch is, arguably, ugly as hell, and creates a certain > "yerkiness", though it does its job. One of the side > effects this flicker causes is complete crashes and lockups with > video overlays which are avoided by the patch. > That is, if you play a video with xine, and then pan over a > forbidden position, the machine crashes and comes > to a complete stop. > > Sorry if the patch format isn't quite right, and the patch is not > quite in a final state (not yet fully tested on all possible > combinations of panning dimensions and display depths), but it's a > start and "works good enough for me". Patch is pretty badly whitespace mangled please format it according to Documentation/SubmittingPatches (git format-patch preferred). Also I think we should conditionalize this on i830M only, I don't see any other reports. One thing to try out still: Does this still work if you tell the ddx to use a linear frontbuffer? -Daniel > > For that, patch: i9xx_update_plane(...) in intel_display.c, > > if (INTEL_INFO(dev)->gen >= 4) { > I915_MODIFY_DISPBASE(DSPSURF(plane), > i915_gem_obj_ggtt_offset(obj) + > intel_crtc->dspaddr_offset); > I915_WRITE(DSPTILEOFF(plane), (y << 16) | x); > I915_WRITE(DSPLINOFF(plane), linear_offset); > + } else if (INTEL_INFO(dev)->gen == 2) { > + int xflick = (x >> 4) & 0x03; > + if (xflick == 3) { /* in forbidden column, probably a > i830 bug */ > + int xfix = 16 + (x & ~(0x3f)); > + int fix_offset = y * fb->pitches[0] + xfix * > (fb->bits_per_pixel / 8); > + I915_WRITE(DSPADDR(plane), i915_gem_obj_ggtt_offset(obj) + > fix_offset); > + POSTING_READ(reg); > + intel_wait_for_vblank(dev, intel_crtc->pipe); > + } > + I915_WRITE(DSPADDR(plane), i915_gem_obj_ggtt_offset(obj) + > linear_offset); > } else > I915_WRITE(DSPADDR(plane), i915_gem_obj_ggtt_offset(obj) + > linear_offset); > POSTING_READ(reg); > > The trick is, as you see, first to display the one frame the display > scrolled off *before* the forbidden column, and > then scroll to the right position, going to the right. )-: > > *Why* that works is unclear to me. Don't ask, just observation. > > An improvement would be to check whether the x position did change, > and if it did not, just avoid all the hack to > allow smooth vertical scrolling. Still to be done. Maybe later the > week if the above also works on the R31 > (affected by the same problem). > > Greetings, > Thomas > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch