http://bugzilla.novell.com/show_bug.cgi?id=615649
http://bugzilla.novell.com/show_bug.cgi?id=615649#c35
--- Comment #35 from Andre Barros 2010-07-23 23:17:14 UTC ---
OK, the patch against openSUSE original src.rpm (version is 2.6.34-14.2).
--------------------------------------------------------------------------------
--- linux-2.6.34/drivers/gpu/drm/i915/intel_drv.h 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/intel_drv.h 2010-07-23
15:48:34.864245286 -0300
@@ -219,6 +219,7 @@
extern void intel_prepare_page_flip(struct drm_device *dev, int plane);
extern void intel_finish_page_flip(struct drm_device *dev, int pipe);
+extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane);
extern void intel_setup_overlay(struct drm_device *dev);
extern void intel_cleanup_overlay(struct drm_device *dev);
--- linux-2.6.34/drivers/gpu/drm/i915/intel_dp.c 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/intel_dp.c 2010-07-23
15:18:05.354242182 -0300
@@ -1180,16 +1180,6 @@
if (HAS_PCH_SPLIT(dev))
return ironlake_dp_detect(connector);
- temp = I915_READ(PORT_HOTPLUG_EN);
-
- I915_WRITE(PORT_HOTPLUG_EN,
- temp |
- DPB_HOTPLUG_INT_EN |
- DPC_HOTPLUG_INT_EN |
- DPD_HOTPLUG_INT_EN);
-
- POSTING_READ(PORT_HOTPLUG_EN);
-
switch (dp_priv->output_reg) {
case DP_B:
bit = DPB_HOTPLUG_INT_STATUS;
--- linux-2.6.34/drivers/gpu/drm/i915/i915_drv.c 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/i915_drv.c 2010-07-20
21:33:16.000000000 -0300
@@ -533,7 +533,7 @@
.open = drm_open,
.release = drm_release,
.unlocked_ioctl = drm_ioctl,
- .mmap = drm_gem_mmap,
+ .mmap = i915_gem_mmap,
.poll = drm_poll,
.fasync = drm_fasync,
.read = drm_read,
--- linux-2.6.34/drivers/gpu/drm/i915/i915_irq.c 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/i915_irq.c 2010-07-23
14:47:43.883992471 -0300
@@ -932,22 +932,30 @@
mod_timer(&dev_priv->hangcheck_timer, jiffies +
DRM_I915_HANGCHECK_PERIOD);
}
- if (iir & I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT)
+ if (iir & I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT) {
intel_prepare_page_flip(dev, 0);
+ if (dev_priv->flip_pending_is_done)
+ intel_finish_page_flip_plane(dev, 0);
+ }
- if (iir & I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT)
+ if (iir & I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT) {
intel_prepare_page_flip(dev, 1);
+ if (dev_priv->flip_pending_is_done)
+ intel_finish_page_flip_plane(dev, 1);
+ }
if (pipea_stats & vblank_status) {
vblank++;
drm_handle_vblank(dev, 0);
- intel_finish_page_flip(dev, 0);
+ if (!dev_priv->flip_pending_is_done)
+ intel_finish_page_flip(dev, 0);
}
if (pipeb_stats & vblank_status) {
vblank++;
drm_handle_vblank(dev, 1);
- intel_finish_page_flip(dev, 1);
+ if (!dev_priv->flip_pending_is_done)
+ intel_finish_page_flip(dev, 1);
}
if ((pipeb_stats & I915_LEGACY_BLC_EVENT_STATUS) ||
--- linux-2.6.34/drivers/gpu/drm/i915/i915_dma.c 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/i915_dma.c 2010-07-23
15:34:02.408243093 -0300
@@ -1488,6 +1488,10 @@
if (ret)
goto destroy_ringbuffer;
+ /* IIR "flip pending" bit means done if this bit is set */
+ if (IS_GEN3(dev) && (I915_READ(ECOSKPD) & ECO_FLIP_DONE))
+ dev_priv->flip_pending_is_done = true;
+
intel_modeset_init(dev);
ret = drm_irq_install(dev);
--- linux-2.6.34/drivers/gpu/drm/i915/i915_gem.c 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/i915_gem.c 2010-07-20
21:33:16.000000000 -0300
@@ -1146,6 +1146,17 @@
return 0;
}
+#ifdef CONFIG_XEN
+int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+ int ret = drm_gem_mmap(filp, vma);
+
+ pgprot_val(vma->vm_page_prot) |= _PAGE_IOMAP;
+
+ return ret;
+}
+#endif
+
/**
* i915_gem_fault - fault a page into the GTT
* vma: VMA in question
--- linux-2.6.34/drivers/gpu/drm/i915/i915_drv.h 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/i915_drv.h 2010-07-23
15:25:38.944242968 -0300
@@ -611,6 +611,7 @@
struct drm_crtc *plane_to_crtc_mapping[2];
struct drm_crtc *pipe_to_crtc_mapping[2];
wait_queue_head_t pending_flip_queue;
+ bool flip_pending_is_done;
/* Reclocking support */
bool render_reclock_avail;
@@ -926,6 +927,11 @@
uint32_t i915_add_request(struct drm_device *dev, struct drm_file *file_priv,
uint32_t flush_domains);
int i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int
interruptible);
+#ifdef CONFIG_XEN
+int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma);
+#else
+#define i915_gem_mmap drm_gem_mmap
+#endif
int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj,
int write);
--- linux-2.6.34/drivers/gpu/drm/i915/intel_display.c 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/intel_display.c 2010-07-23
17:33:54.807242186 -0300
@@ -4137,10 +4137,10 @@
kfree(work);
}
-void intel_finish_page_flip(struct drm_device *dev, int pipe)
+static void do_intel_finish_page_flip(struct drm_device *dev,
+ struct drm_crtc *crtc)
{
drm_i915_private_t *dev_priv = dev->dev_private;
- struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_unpin_work *work;
struct drm_i915_gem_object *obj_priv;
@@ -4155,12 +4155,6 @@
spin_lock_irqsave(&dev->event_lock, flags);
work = intel_crtc->unpin_work;
if (work == NULL || !work->pending) {
- if (work && !work->pending) {
- obj_priv = to_intel_bo(work->pending_flip_obj);
- DRM_DEBUG_DRIVER("flip finish: %p (%d) not pending?\n",
- obj_priv,
- atomic_read(&obj_priv->pending_flip));
- }
spin_unlock_irqrestore(&dev->event_lock, flags);
return;
}
@@ -4190,6 +4184,22 @@
schedule_work(&work->work);
}
+void intel_finish_page_flip(struct drm_device *dev, int pipe)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
+
+ do_intel_finish_page_flip(dev, crtc);
+}
+
+void intel_finish_page_flip_plane(struct drm_device *dev, int plane)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ struct drm_crtc *crtc = dev_priv->plane_to_crtc_mapping[plane];
+
+ do_intel_finish_page_flip(dev, crtc);
+}
+
void intel_prepare_page_flip(struct drm_device *dev, int plane)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -4220,6 +4230,7 @@
unsigned long flags;
int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC;
int ret, pipesrc;
+ u32 flip_mask;
RING_LOCALS;
work = kzalloc(sizeof *work, GFP_KERNEL);
@@ -4270,15 +4281,28 @@
atomic_inc(&obj_priv->pending_flip);
work->pending_flip_obj = obj;
+ if (intel_crtc->plane)
+ flip_mask = I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT;
+ else
+ flip_mask = I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT;
+
+ /* Wait for any previous flip to finish */
+ if (IS_GEN3(dev))
+ while (I915_READ(ISR) & flip_mask)
+ ;
+
BEGIN_LP_RING(4);
- OUT_RING(MI_DISPLAY_FLIP |
- MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
- OUT_RING(fb->pitch);
if (IS_I965G(dev)) {
+ OUT_RING(MI_DISPLAY_FLIP |
+ MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+ OUT_RING(fb->pitch);
OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode);
pipesrc = I915_READ(pipesrc_reg);
OUT_RING(pipesrc & 0x0fff0fff);
} else {
+ OUT_RING(MI_DISPLAY_FLIP_I915 |
+ MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+ OUT_RING(fb->pitch);
OUT_RING(obj_priv->gtt_offset);
OUT_RING(MI_NOOP);
}
--- linux-2.6.34/drivers/gpu/drm/i915/i915_reg.h 2010-05-16
18:17:36.000000000 -0300
+++ linux-2.6.34-14.2/drivers/gpu/drm/i915/i915_reg.h 2010-07-23
17:26:52.544242460 -0300
@@ -178,6 +178,7 @@
#define MI_OVERLAY_OFF (0x2<<21)
#define MI_LOAD_SCAN_LINES_INCL MI_INSTR(0x12, 0)
#define MI_DISPLAY_FLIP MI_INSTR(0x14, 2)
+#define MI_DISPLAY_FLIP_I915 MI_INSTR(0x14, 1)
#define MI_DISPLAY_FLIP_PLANE(n) ((n) << 20)
#define MI_STORE_DWORD_IMM MI_INSTR(0x20, 1)
#define MI_MEM_VIRTUAL (1 << 22) /* 965+ only */
@@ -368,6 +369,9 @@
#define BB_ADDR 0x02140 /* 8 bytes */
#define GFX_FLSH_CNTL 0x02170 /* 915+ only */
+#define ECOSKPD 0x021d0
+#define ECO_GATING_CX_ONLY (1<<3)
+#define ECO_FLIP_DONE (1<<0)
/*
* Framebuffer compression (915+ only)
--------------------------------------------------------------------------------
Still, want help with the Makefile.
Also, as a side note, would like to know if the openSUSE development system has
a kind of structure like of Fedora source
(http://cvs.fedoraproject.org/viewvc/rpms/) or like Debian
(http://patch-tracker.debian.org/) patch system, from where we could grab just
the patches. Sucks to download the whole package to be able to discover what
patches are included. It may make contribution to openSUSE development a bit
harder.
Regards,
Andre
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.