xf86-video-intel: 4 commits - src/sna/kgem.c src/sna/sna_display.c src/sna/sna_dri2.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Jul 17 00:51:54 PDT 2015
src/sna/kgem.c | 8 ++---
src/sna/sna_display.c | 68 +++++++++++++++++++++++++++-----------------------
src/sna/sna_dri2.c | 5 ++-
3 files changed, 46 insertions(+), 35 deletions(-)
New commits:
commit 57725564179b8ddb48d5c9437fde91a6c02c0740
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jul 16 19:10:29 2015 +0100
sna/dri2: Fix vblank keepalive signalling
When emitting the keepalive, it helps to actually request the signal
from the kernel.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 47bc046..13714fb 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2601,7 +2601,10 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event)
DRM_VBLANK_EVENT;
vbl.request.sequence = 1;
vbl.request.signal = (uintptr_t)info;
- return;
+ if (!sna_wait_vblank(sna, &vbl, info->pipe))
+ return;
+
+ info->queued = false;
}
done:
commit 6d3802972886be426fe00f3abf2eedba4f6cb393
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jul 16 14:31:50 2015 +0100
sna: Block cursor signals during modeset
Modesetting can be slow, and we certainly don't want to have to keep
restarting it due to an interrupt from an invisible cursor.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index a06b1a0..7b082f5 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -828,6 +828,29 @@ done:
sna_output->backlight.iface, best_iface, output->name);
}
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0)
+static inline int sigio_block(void)
+{
+ OsBlockSIGIO();
+ return 0;
+}
+static inline void sigio_unblock(int was_blocked)
+{
+ OsReleaseSIGIO();
+ (void)was_blocked;
+}
+#else
+#include <xf86_OSproc.h>
+static inline int sigio_block(void)
+{
+ return xf86BlockSIGIO();
+}
+static inline void sigio_unblock(int was_blocked)
+{
+ xf86UnblockSIGIO(was_blocked);
+}
+#endif
+
static char *canonical_kmode_name(const struct drm_mode_modeinfo *kmode)
{
char tmp[32], *buf;
@@ -1075,7 +1098,8 @@ sna_crtc_apply(xf86CrtcPtr crtc)
struct drm_mode_crtc arg;
uint32_t output_ids[32];
int output_count = 0;
- int i;
+ int sigio, i;
+ bool ret = false;
DBG(("%s CRTC:%d [pipe=%d], handle=%d\n", __FUNCTION__,
__sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc),
@@ -1086,6 +1110,8 @@ sna_crtc_apply(xf86CrtcPtr crtc)
return false;
}
+ sigio = sigio_block();
+
assert(sna->mode.num_real_output < ARRAY_SIZE(output_ids));
sna_crtc_disable_cursor(sna, sna_crtc);
@@ -1093,7 +1119,7 @@ sna_crtc_apply(xf86CrtcPtr crtc)
ERR(("%s: set-primary-rotation failed (rotation-id=%d, rotation=%d) on CRTC:%d [pipe=%d], errno=%d\n",
__FUNCTION__, sna_crtc->primary.rotation.prop, sna_crtc->rotation, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc), errno));
sna_crtc->primary.rotation.supported &= ~sna_crtc->rotation;
- return false;
+ goto unblock;
}
DBG(("%s: CRTC:%d [pipe=%d] primary rotation set to %x\n",
__FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc), sna_crtc->rotation));
@@ -1133,13 +1159,13 @@ sna_crtc_apply(xf86CrtcPtr crtc)
DBG(("%s: too many outputs (%d) for me!\n",
__FUNCTION__, output_count));
errno = EINVAL;
- return false;
+ goto unblock;
}
}
if (output_count == 0) {
DBG(("%s: no outputs\n", __FUNCTION__));
errno = EINVAL;
- return false;
+ goto unblock;
}
VG_CLEAR(arg);
@@ -1170,12 +1196,13 @@ sna_crtc_apply(xf86CrtcPtr crtc)
sna_crtc->transform ? " [transformed]" : "",
output_count, output_count ? output_ids[0] : 0));
- if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg))
- return false;
+ ret = drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg) == 0;
sna_crtc->mode_serial++;
sna_crtc_force_outputs_on(crtc);
- return true;
+unblock:
+ sigio_unblock(sigio);
+ return ret;
}
static bool overlap(const BoxRec *a, const BoxRec *b)
@@ -5225,29 +5252,6 @@ sna_realize_cursor(xf86CursorInfoPtr info, CursorPtr cursor)
return NULL;
}
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0)
-static inline int sigio_block(void)
-{
- OsBlockSIGIO();
- return 0;
-}
-static inline void sigio_unblock(int was_blocked)
-{
- OsReleaseSIGIO();
- (void)was_blocked;
-}
-#else
-#include <xf86_OSproc.h>
-static inline int sigio_block(void)
-{
- return xf86BlockSIGIO();
-}
-static inline void sigio_unblock(int was_blocked)
-{
- xf86UnblockSIGIO(was_blocked);
-}
-#endif
-
static void enable_fb_access(ScrnInfoPtr scrn, int state)
{
scrn->EnableDisableFBAccess(
commit 6f4a14303298e4c86080b76993bc15a0188679ae
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jul 16 10:30:10 2015 +0100
sna: Stop trying to CPU mmap a prime object after failure
If we fail to CPU mmap an object, mark it as inaccessible and never try
again. The likely scenario is that is it a PRIME object not backed by
our shmemfs storage and so unmappable.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 68f3128..44259a8 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -659,7 +659,7 @@ retry:
arg.offset = 0;
arg.size = bytes(bo);
if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) {
- assert(err != EINVAL);
+ assert(err != -EINVAL || bo->prime);
if (__kgem_throttle_retire(kgem, 0))
goto retry;
@@ -667,8 +667,9 @@ retry:
if (kgem_cleanup_cache(kgem))
goto retry;
- ERR(("%s: failed to mmap handle=%d, %d bytes, into CPU domain: %d\n",
- __FUNCTION__, bo->handle, bytes(bo), -err));
+ ERR(("%s: failed to mmap handle=%d (prime? %d), %d bytes, into CPU domain: %d\n",
+ __FUNCTION__, bo->handle, bo->prime, bytes(bo), -err));
+ bo->purged = 1;
return NULL;
}
@@ -4638,7 +4639,6 @@ struct kgem_bo *kgem_create_for_name(struct kgem *kgem, uint32_t name)
bo->tiling = tiling.tiling_mode;
bo->reusable = false;
bo->prime = true;
- bo->purged = true; /* no coherency guarantees */
debug_alloc__bo(kgem, bo);
return bo;
commit b549b4fd38cd23623dec7fdb9800e590a9b37c0b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jul 16 10:16:07 2015 +0100
sna: Add a DBG option to control native rotations for testing
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 3fa6c25..a06b1a0 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -132,6 +132,8 @@ struct local_mode_obj_get_properties {
#define __DBG(x)
#endif
+#define DBG_NATIVE_ROTATION ~0 /* minimum RR_Rotate_0 */
+
extern XF86ConfigPtr xf86configptr;
struct sna_cursor {
@@ -2832,6 +2834,8 @@ static int plane_details(struct sna *sna, struct plane *p)
}
}
+ p->rotation.supported &= DBG_NATIVE_ROTATION;
+
if (props != (uint32_t *)stack_props)
free(props);
More information about the xorg-commit
mailing list