[Intel-gfx] [PATCH] drm/i915: add SNB video sprite support
Lan, Hai
hai.lan at intel.com
Tue Nov 1 15:11:43 CET 2011
Hi Jesse,
I hope the function of snb_update_plane can handle crtx_x<0 or crtc_y<0 just like my patch.
What do you think about it?
Thanks and best regards.
Hai Lan
From 160c899739e7d07f273de889cc889316837d0790 Mon Sep 17 00:00:00 2001
From: Hai Lan <hai.lan at intel.com>
Date: Tue, 1 Nov 2011 21:30:08 -0400
Subject: [PATCH] drm/i915:add overlay support for crtc_x < 0 or crtc_y < 0
Signed-off-by: Hai Lan <hai.lan at intel.com>
---
drivers/gpu/drm/i915/intel_overlay2.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_overlay2.c b/drivers/gpu/drm/i915/intel_overlay2.c
index ff9f0ea..7eba888 100644
--- a/drivers/gpu/drm/i915/intel_overlay2.c
+++ b/drivers/gpu/drm/i915/intel_overlay2.c
@@ -193,6 +193,22 @@ snb_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
return -EINVAL;
/* Clamp the width & height into the visible area */
+ if ((crtc_x < 0) && ((crtc_x + crtc_w)>0)) {
+ crtc_w += crtc_x;
+ crtc_x = 0;
+ }
+ if ((crtc_y < 0) && ((crtc_y + crtc_h)>0)) {
+ crtc_h += crtc_y;
+ crtc_y = 0;
+ }
+ if ((crtc_x +crtc_w) < 0) {
+ crtc_w = 0;
+ crtc_x = 0;
+ }
+ if ((crtc_y +crtc_h) < 0) {
+ crtc_h = 0;
+ crtc_y = 0;
+ }
if (crtc_x + crtc_w > active_w)
crtc_w = active_w - crtc_x - 1;
if (crtc_y + crtc_h > active_h)
--
1.7.0.1
More information about the Intel-gfx
mailing list