OSDN Git Service

The {width, height} in VEBOX_SURFACE_STATE is in unit of pixel
authorXiang, Haihao <haihao.xiang@intel.com>
Mon, 26 Sep 2016 01:48:35 +0000 (09:48 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 31 Oct 2016 02:00:08 +0000 (10:00 +0800)
v2: The ending position in VEB_DI_IECP must be within the surface region

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 20edbb18570d5ec5e87906d87afa98885c12fac7)

src/gen75_vpp_vebox.c

index 5206615..3d85987 100644 (file)
@@ -1030,8 +1030,8 @@ void hsw_veb_surface_state(VADriverContextP ctx, struct intel_vebox_context *pro
                   is_output);      // surface indentification.
 
     OUT_VEB_BATCH(batch,
-                  (obj_surf->height - 1) << 18 |  // height . w3
-                  (obj_surf->width -1 )  << 4  |  // width
+                  (obj_surf->orig_height - 1) << 18 |  // height . w3
+                  (obj_surf->orig_width - 1)  << 4  |  // width
                   0);                             // reserve
 
     OUT_VEB_BATCH(batch,
@@ -1062,7 +1062,12 @@ void hsw_veb_dndi_iecp_command(VADriverContextP ctx, struct intel_vebox_context
 {
     struct intel_batchbuffer *batch = proc_ctx->batch;
     unsigned char frame_ctrl_bits = 0;
-    const unsigned int width64 = ALIGN(proc_ctx->width_input, 64);
+    struct object_surface *obj_surface = proc_ctx->frame_store[FRAME_IN_CURRENT].obj_surface;
+    unsigned int width64 = ALIGN(proc_ctx->width_input, 64);
+
+    assert(obj_surface);
+    if (width64 > obj_surface->orig_width)
+        width64 = obj_surface->orig_width;
 
     /* s1:update the previous and current input */
 /*    tempFrame = proc_ctx->frame_store[FRAME_IN_PREVIOUS];
@@ -1879,7 +1884,12 @@ void bdw_veb_dndi_iecp_command(VADriverContextP ctx, struct intel_vebox_context
 {
     struct intel_batchbuffer *batch = proc_ctx->batch;
     unsigned char frame_ctrl_bits = 0;
-    const unsigned int width64 = ALIGN(proc_ctx->width_input, 64);
+    struct object_surface *obj_surface = proc_ctx->frame_store[FRAME_IN_CURRENT].obj_surface;
+    unsigned int width64 = ALIGN(proc_ctx->width_input, 64);
+
+    assert(obj_surface);
+    if (width64 > obj_surface->orig_width)
+        width64 = obj_surface->orig_width;
 
     BEGIN_VEB_BATCH(batch, 0x14);
     OUT_VEB_BATCH(batch, VEB_DNDI_IECP_STATE | (0x14 - 2));//DWord 0
@@ -2372,8 +2382,8 @@ void skl_veb_surface_state(VADriverContextP ctx, struct intel_vebox_context *pro
                   is_output);      // surface indentification.
 
     OUT_VEB_BATCH(batch,
-                  (obj_surf->height - 1) << 18 |  // height . w3
-                  (obj_surf->width -1 )  << 4  |  // width
+                  (obj_surf->orig_height - 1) << 18 |  // height . w3
+                  (obj_surf->orig_width - 1)  << 4  |  // width
                   0);                             // reserve
 
     OUT_VEB_BATCH(batch,