xf86-video-intel: src/i830_common.h src/i830_dri.c src/i830_driver.c src/i830.h
Keith Packard
keithp at kemper.freedesktop.org
Mon Jun 19 23:49:16 EEST 2006
src/i830.h | 1 +
src/i830_common.h | 9 +++++++++
src/i830_dri.c | 25 +++++++++++++++++++++++++
src/i830_driver.c | 6 ++++++
4 files changed, 41 insertions(+)
New commits:
diff-tree 8a6edba33213911cc2210b5e903428b81d45862f (from a73ab7f0e6e3b0462e05c0031ffd602ed3e2bcd4)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Mon Jun 19 13:47:28 2006 -0700
Set vblank interrupt configuration to match pipe configuration
New i915 drm ioctl (in version 1.5) allows the X server to select
which pipe drives vblank interrupts. Use this to drive from the 'preferred'
pipe. Yes, per-window vblanks would be nice in a shared fb environment.
Maybe someday.
(cherry picked from 2fb375b665f4802819b89f2277fd6154006c11ee commit)
diff --git a/src/i830.h b/src/i830.h
index 4fa3328..4fc3987 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -427,6 +427,7 @@ extern void I830DRIUnmapScreenRegions(Sc
extern Bool I830DRIMapScreenRegions(ScrnInfoPtr pScrn, drmI830Sarea *sarea);
extern void I830DRIUnlock(ScrnInfoPtr pScrn);
extern Bool I830DRILock(ScrnInfoPtr pScrn);
+extern Bool I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on);
#endif
extern Bool I830AccelInit(ScreenPtr pScreen);
diff --git a/src/i830_common.h b/src/i830_common.h
index 41b5cc3..a27bc01 100644
--- a/src/i830_common.h
+++ b/src/i830_common.h
@@ -52,6 +52,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define DRM_I830_INIT_HEAP 0x0a
#define DRM_I830_CMDBUFFER 0x0b
#define DRM_I830_DESTROY_HEAP 0x0c
+#define DRM_I830_SET_VBLANK_PIPE 0x0d
+#define DRM_I830_GET_VBLANK_PIPE 0x0e
+
typedef struct {
enum {
@@ -193,5 +196,11 @@ typedef struct {
int region;
} drmI830MemDestroyHeap;
+#define DRM_I830_VBLANK_PIPE_A 1
+#define DRM_I830_VBLANK_PIPE_B 2
+
+typedef struct {
+ int pipe;
+} drmI830VBlankPipe;
#endif /* _I830_DRM_H_ */
diff --git a/src/i830_dri.c b/src/i830_dri.c
index ed5e685..7c65f65 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1454,6 +1454,31 @@ I830UpdateDRIBuffers(ScrnInfoPtr pScrn,
}
Bool
+I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+ drmI830VBlankPipe pipe;
+
+ if (pI830->directRenderingEnabled && pI830->drmMinor >= 5) {
+ if (on) {
+ if (pI830->planeEnabled[1])
+ pipe.pipe = DRM_I830_VBLANK_PIPE_B;
+ else
+ pipe.pipe = DRM_I830_VBLANK_PIPE_A;
+ } else {
+ pipe.pipe = 0;
+ }
+ if (drmCommandWrite(pI830->drmSubFD, DRM_I830_SET_VBLANK_PIPE,
+ &pipe, sizeof (pipe))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830 Vblank Pipe Setup Failed\n");
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+Bool
I830DRILock(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index a4b891b..907b204 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3826,6 +3826,9 @@ RestoreHWState(ScrnInfoPtr pScrn)
DPRINTF(PFX, "RestoreHWState\n");
+#ifdef XF86DRI
+ I830DRISetVBlankInterrupt (pScrn, FALSE);
+#endif
if (I830IsPrimary(pScrn) && pI830->pipe != pI830->origPipe)
SetBIOSPipe(pScrn, pI830->origPipe);
else
@@ -4411,6 +4414,9 @@ I830VESASetMode(ScrnInfoPtr pScrn, Displ
#endif
#ifdef XF86DRI
+ I830DRISetVBlankInterrupt (pScrn, TRUE);
+#endif
+#ifdef XF86DRI
if (didLock)
I830DRIUnlock(pScrn);
#endif
More information about the xorg-commit
mailing list