xf86-video-intel: 3 commits - src/sna/sna_accel.c src/sna/sna_video_overlay.c
Chris Wilson
ickle at kemper.freedesktop.org
Tue May 29 14:17:40 PDT 2012
src/sna/sna_accel.c | 11 +++++------
src/sna/sna_video_overlay.c | 18 ++++++------------
2 files changed, 11 insertions(+), 18 deletions(-)
New commits:
commit 68874e2d694cc68f5f051ba5fe4a79a71fdb2dbc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue May 29 21:28:39 2012 +0100
sna: Fix chunking for large stipples
Reported-and-tested-by: Matti Hamalainen <ccr at tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49510
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 9029d9f..72bb893 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -9751,7 +9751,7 @@ sna_poly_fill_rect_stippled_n_box(struct sna *sna,
uint32_t *b;
for (y1 = box->y1; y1 < box->y2; y1 = y2) {
- int oy = (y1 - origin->y) % gc->stipple->drawable.height;
+ int oy = (y1 - origin->y) % gc->stipple->drawable.height;
y2 = box->y2;
if (y2 - y1 > gc->stipple->drawable.height - oy)
@@ -9765,12 +9765,11 @@ sna_poly_fill_rect_stippled_n_box(struct sna *sna,
ox = (x1 - origin->x) % gc->stipple->drawable.width;
bx1 = ox & ~7;
bx2 = ox + (x2 - x1);
- if (bx2 - bx1 > gc->stipple->drawable.width) {
- bx2 = bx1 + gc->stipple->drawable.width;
- x2 = x1 + (bx1-ox) + gc->stipple->drawable.width;
+ if (bx2 > gc->stipple->drawable.width) {
+ bx2 = gc->stipple->drawable.width;
+ x2 = x1 + bx2-ox;
}
- bx2 = (bx2 + 7) & ~7;
- bw = (bx2 - bx1)/8;
+ bw = (bx2 - bx1 + 7)/8;
bw = ALIGN(bw, 2);
bh = y2 - y1;
commit 12af82581118470f59817f626d61df655950e243
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue May 29 21:45:32 2012 +0100
sna/overlay: Replace drmCommand with direct invocations of drmIoctl
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index d7a62f3..c39bbfc 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -113,10 +113,8 @@ static Bool sna_has_overlay(struct sna *sna)
gp.param = I915_PARAM_HAS_OVERLAY;
gp.value = &has_overlay;
- ret = drmCommandWriteRead(sna->kgem.fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
-
- return !! has_overlay;
- (void)ret;
+ ret = drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp);
+ return ret > 0 && has_overlay;
}
static Bool sna_video_overlay_update_attrs(struct sna *sna,
@@ -138,22 +136,18 @@ static Bool sna_video_overlay_update_attrs(struct sna *sna,
attrs.gamma4 = video->gamma4;
attrs.gamma5 = video->gamma5;
- return drmCommandWriteRead(sna->kgem.fd, DRM_I915_OVERLAY_ATTRS,
- &attrs, sizeof(attrs)) == 0;
+ return drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_OVERLAY_ATTRS, &attrs) == 0;
}
static void sna_video_overlay_off(struct sna *sna)
{
struct drm_intel_overlay_put_image request;
- int ret;
DBG(("%s()\n", __FUNCTION__));
request.flags = 0;
- ret = drmCommandWrite(sna->kgem.fd, DRM_I915_OVERLAY_PUT_IMAGE,
- &request, sizeof(request));
- (void)ret;
+ drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_OVERLAY_PUT_IMAGE, &request);
}
static void sna_video_overlay_stop(ScrnInfoPtr scrn,
@@ -448,8 +442,7 @@ sna_video_overlay_show(struct sna *sna,
DBG(("%s: flags=%x\n", __FUNCTION__, request.flags));
- return drmCommandWrite(sna->kgem.fd, DRM_I915_OVERLAY_PUT_IMAGE,
- &request, sizeof(request)) == 0;
+ return drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_OVERLAY_PUT_IMAGE, &request) == 0;
}
static int
commit 3a1b6e57fbbbb4c8e5ac9588537840f4ec176ae6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue May 29 21:37:16 2012 +0100
sna/overlay: Restore one xf86drm.h include
This was removed in haste, when it is required for drmIoctl and friends.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index eb39a25..d7a62f3 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -31,6 +31,7 @@
#include "sna.h"
#include "sna_video.h"
+#include <xf86drm.h>
#include <xf86xv.h>
#include <X11/extensions/Xv.h>
#include <fourcc.h>
More information about the xorg-commit
mailing list