]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/omapdrmtest.git/commitdiff
fixes for proper stride for tiled buffers
authorRob Clark <rob@ti.com>
Thu, 1 Mar 2012 17:14:02 +0000 (11:14 -0600)
committerRob Clark <rob@ti.com>
Thu, 1 Mar 2012 17:14:02 +0000 (11:14 -0600)
util/display-kms.c
util/display-x11.c
util/util.h

index 35e9a3d43c1afe69281ec98889d77cd074a999b9..f64aef0c407c3cc6b941ed5a584aeeb9f79f4152 100644 (file)
@@ -93,6 +93,8 @@ alloc_bo(struct display *disp, uint32_t bpp, uint32_t width, uint32_t height,
        if (bo) {
                *bo_handle = omap_bo_handle(bo);
                *pitch = width * bpp / 8;
+               if (bo_flags & OMAP_BO_TILED)
+                       *pitch = ALIGN2(*pitch, PAGE_SHIFT);
        }
 
        return bo;
index 758b08fb60ac50c270e4d3292f44d72c82162254..d63f5e8c179b1d7594631a26c01f86579b5b1bac 100644 (file)
@@ -110,7 +110,9 @@ get_vid_buffers(struct display *disp, uint32_t n,
 
                for (j = 0; dri2bufs[i].names[j]; j++) {
                        buf->bo[j] = omap_bo_from_name(disp->dev, dri2bufs[i].names[j]);
+                       buf->pitches[j] = dri2bufs[i].pitch[j];
                }
+
                buf->nbo = j;
 
                bufs[i] = buf;
index 23e423391e1ba9849a972a909eb255000244136d..bf3323472b5fa92bc9ddb1cba384dad5257db3a9 100644 (file)
@@ -167,6 +167,14 @@ void fill(struct buffer *buf, int i);
 #  define MAX(a,b)     (((a) > (b)) ? (a) : (b))
 #endif
 
+#ifndef PAGE_SHIFT
+#  define PAGE_SHIFT 12
+#endif
+
+#ifndef PAGE_SIZE
+#  define PAGE_SIZE (1 << PAGE_SHIFT)
+#endif
+
 /* align x to next highest multiple of 2^n */
 #define ALIGN2(x,n)   (((x) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))