set the pitch of image from buffer to the buffer's pitch.

Submitted by Guo Yejun on Oct. 26, 2015, 2:09 p.m.

Details

Message ID 854E8DBA9F41904AB047E03BB6963AE52294CB7A@SHSMSX101.ccr.corp.intel.com
State New
Headers show
Series "set the pitch of image from buffer to the buffer's pitch." ( rev: 2 ) in Beignet

Not browsing as part of any series.

Commit Message

Guo Yejun Oct. 26, 2015, 2:09 p.m.
One comment.

-----Original Message-----
From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of xionghu.luo@intel.com

Sent: Monday, October 26, 2015 3:51 PM
To: beignet@lists.freedesktop.org
Cc: Luo, Xionghu
Subject: [Beignet] [PATCH] set the pitch of image from buffer to the buffer's pitch.

From: Luo Xionghu <xionghu.luo@intel.com>


if image from buffer, the image's pitch should be same with buffer bo's row pitch.

Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>

---
 src/cl_mem.c | 7 +++++++
 1 file changed, 7 insertions(+)

       aligned_h  = ALIGN(h, cl_buffer_get_tiling_align(ctx, CL_NO_TILE, 1));
   } else if (tiling == CL_TILE_X) {
--
1.9.1

_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

Patch hide | download patch | download mbox

diff --git a/src/cl_mem.c b/src/cl_mem.c index cb2af47..67fcf57 100644
--- a/src/cl_mem.c
+++ b/src/cl_mem.c
@@ -851,8 +851,15 @@  _cl_mem_new_image(cl_context ctx,
     if (aligned_pitch < pitch && enableUserptr)
       aligned_pitch = pitch;
[yejun] can the logic be merged here?

     //no need align the height if 2d image from buffer.
+    //the pitch should be same with buffer's pitch as they share same bo.
     if (image_type == CL_MEM_OBJECT_IMAGE2D && buffer != NULL)
+    {
+      if(aligned_pitch < pitch)
+      {
+        aligned_pitch = pitch;
+      }
       aligned_h = h;
+    }
     else