All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Pipe-A underrun workaround for i830 chipset.
@ 2013-11-14 17:17 Thomas Richter
  2013-11-14 18:51 ` Daniel Vetter
       [not found] ` <26136_1384455070_52851B9E_26136_18661_1_20131114185141.GJ22741@phenom.ffwll.local>
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Richter @ 2013-11-14 17:17 UTC (permalink / raw)
  To: Daniel Vetter, intel-gfx

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

Dear Daniel, dear intel-experts,

please find a patch for the dreadful pipe-A underruns on the i830 
attached that works at least in the linear framebuffer mode. As far as 
the tiling mode is concerned, I'm still scratching my head about it. It 
as at this time unclear how precisely this works, but I'll keep looking.
At least this is something.

So long,
	Thomas

[-- Attachment #2: 0011-Added-a-workaround-for-pipe-A-underruns-on-i830-with.patch --]
[-- Type: text/x-patch, Size: 3245 bytes --]

>From ba72c1e506bb162f8ac595af94cc6ed850439883 Mon Sep 17 00:00:00 2001
From: Thomas Richter <thor@math.tu-berlin.de>
Date: Thu, 14 Nov 2013 18:16:14 +0100
Subject: [PATCH 11/11] Added a workaround for pipe-A underruns on i830 with
 panning.


Signed-off-by: Thomas Richter <thor@math.tu-berlin.de>
---
 drivers/gpu/drm/i915/intel_display.c |   61 ++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 971f6b9..21895b8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2002,6 +2002,64 @@ unsigned long intel_gen4_compute_page_offset(int *x, int *y,
 	}
 }
 
+/*
+** Update the linear frame pointer for i830 based devices. Due to some
+** unknown hardware feature, updating the frame pointer may cause
+** the unified FIFO of these chips run dry, then causing a flicker
+** and a potential shutdown of the video overlay, or worse.
+** thor, 14.11.2013
+*/
+static void i830_update_plane_offset(struct drm_crtc *crtc,
+				     struct drm_framebuffer *fb,
+				     unsigned long linear_offset)
+{
+	struct drm_i915_gem_object *obj;
+	struct intel_framebuffer *intel_fb;
+	struct drm_device *dev = crtc->dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	unsigned long planeadr, oldadr;
+	int plane = intel_crtc->plane;
+	u32 reg = DSPCNTR(plane);
+
+	intel_fb = to_intel_framebuffer(fb);
+	obj = intel_fb->obj;
+
+	planeadr = i915_gem_obj_ggtt_offset(obj) + linear_offset;
+	DRM_DEBUG_KMS("Plane address is 0x%lx", planeadr);
+	/* I830 panning flicker work around.
+	** Only for non-LVDS output, only for i830.
+	** Tiling mode is still not supported.
+	*/
+	if (obj->tiling_mode != I915_TILING_NONE) {
+		if ((planeadr & 0x40)) {
+			DRM_DEBUG_KMS("Detected potential flicker");
+			DRM_DEBUG_KMS("No workaround for tiling mode");
+			DRM_DEBUG_KMS("Use a linear frame buffer");
+		}
+	} else {
+		switch (fb->pixel_format) {
+		case DRM_FORMAT_XRGB1555:
+		case DRM_FORMAT_ARGB1555:
+		case DRM_FORMAT_RGB565:
+		case DRM_FORMAT_XRGB8888:
+		case DRM_FORMAT_ARGB8888:
+		case DRM_FORMAT_XBGR8888:
+		case DRM_FORMAT_ABGR8888:
+			oldadr = I915_READ(DSPADDR(plane));
+			if (((oldadr ^ planeadr) & 0x40) &&
+			    (planeadr & 0xc0) == 0xc0) {
+				I915_WRITE(DSPADDR(plane),
+					   planeadr & (~(0x80)));
+				POSTING_READ(reg);
+				intel_wait_for_vblank(dev, intel_crtc->pipe);
+			}
+			break;
+		}
+	}
+	I915_WRITE(DSPADDR(plane), planeadr);
+}
+
 static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 			     int x, int y)
 {
@@ -2095,6 +2153,9 @@ static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 				     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 && IS_I830(dev) &&
+		   !intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
+		i830_update_plane_offset(crtc, fb, linear_offset);
 	} else
 		I915_WRITE(DSPADDR(plane), i915_gem_obj_ggtt_offset(obj) + linear_offset);
 	POSTING_READ(reg);
-- 
1.7.10.4


[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-14 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 17:17 [PATCH] Pipe-A underrun workaround for i830 chipset Thomas Richter
2013-11-14 18:51 ` Daniel Vetter
     [not found] ` <26136_1384455070_52851B9E_26136_18661_1_20131114185141.GJ22741@phenom.ffwll.local>
2013-11-14 19:02   ` Thomas Richter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.