[Intel-gfx] [PATCH] XvMC: hook up bo passthrough for i915 class hw

Daniel Vetter daniel.vetter at ffwll.ch
Wed Dec 2 12:28:51 CET 2009


... except for i915G/GM, they need special care (and kernel support).
This is fully untested, but it might actually work;)

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 src/i830_video.c |   10 ++++++++--
 src/i915_hwmc.c  |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/i830_video.c b/src/i830_video.c
index 8457764..b549e51 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1566,9 +1566,15 @@ I830PutImageTextured(ScrnInfoPtr scrn,
 				drm_intel_bo_gem_create_from_name(intel->bufmgr,
 								  "xvmc surface",
 								  (uintptr_t)buf);
+		} else if (IS_I915(intel)
+				&& !(IS_I915G(intel) || IS_I915GM(intel))) {
+			adaptor_priv->buf =
+				drm_intel_bo_gem_create_from_name(intel->bufmgr,
+						"XvMC surface",
+						(uintptr_t) buf);
 		} else {
-			/* XXX: i915 is not support and needs some serious care.
-			 * grep for KMS in i915_hwmc.c */
+			/* XXX: i915G/GM is not support and needs some serious
+			 * care.  grep for KMS in i915_hwmc.c */
 			return BadAlloc;
 		}
 	} else {
diff --git a/src/i915_hwmc.c b/src/i915_hwmc.c
index 8be52f2..bd02215 100644
--- a/src/i915_hwmc.c
+++ b/src/i915_hwmc.c
@@ -817,7 +817,7 @@ static int i915_xvmc_put_image(ScrnInfoPtr scrn,
 			/* use char *buf to hold our surface offset...hacky! */
 			buf =
 			    (unsigned char *)pXvMC->sfprivs[xvmc_cmd->srfNo]->
-			    surface->offset;
+			    surface->bo->handle;
 			break;
 		default:
 			return 0;
-- 
1.6.5.3




More information about the Intel-gfx mailing list