[Piglit] [PATCH v2] dmabuf: fix YUV tests for drivers other than intel

Rob Clark robdclark at gmail.com
Fri Sep 9 19:04:45 UTC 2016


On Fri, Sep 9, 2016 at 2:30 PM, Kristian Høgsberg <hoegsberg at gmail.com> wrote:
> On Fri, Sep 9, 2016 at 10:44 AM Rob Clark <robdclark at gmail.com> wrote:
>>
>> diff --git a/tests/spec/ext_image_dma_buf_import/missing_attributes.c
>> b/tests/spec/ext_image_dma_buf_import/missing_attributes.c
>> index d7d89e6..d16b60e 100644
>> --- a/tests/spec/ext_image_dma_buf_import/missing_attributes.c
>> +++ b/tests/spec/ext_image_dma_buf_import/missing_attributes.c
>> @@ -21,6 +21,8 @@
>>   * IN THE SOFTWARE.
>>   */
>>
>> +#include "piglit-framework-gl/piglit_drm_dma_buf.h"
>> +
>>  #include "image_common.h"
>>
>>  /**
>> @@ -105,47 +107,44 @@ piglit_display(void)
>>         const unsigned w = 2;
>>         const unsigned h = 2;
>>         const unsigned cpp = 2;
>
>
> I don't know if this was an issue with the existing test, but cpp = 2
> doesn't match ARGB8888. Probably doesn't matter for this test, but looks
> weird.

oh, yeah, I missed that this one wasn't cpp==4.  Yeah, doesn't matter
for this test, but I'll fix it.

>>
>> +       const unsigned fourcc = DRM_FORMAT_ARGB8888;
>>         const unsigned char *pixels = alloca(w * h * cpp);
>>         EGLint all[2 * NUM_MANDATORY_ATTRS];
>>         EGLint missing[2 * (NUM_MANDATORY_ATTRS - 1) + 1];
>>         struct piglit_dma_buf *buf;
>> -       unsigned stride;
>> -       unsigned offset;
>> -       int fd;
>>         enum piglit_result res;
>>         bool pass = true;
>>
>> -       res = piglit_create_dma_buf(w, h, cpp, pixels, w * cpp,
>> -                               &buf, &fd, &stride, &offset);
>> +       res = piglit_create_dma_buf(w, h, fourcc, pixels, &buf);
>>         if (res != PIGLIT_PASS)
>>                 return res;
>>
>> -       fill_full_set(w, h, fd, offset, stride, all);
>> +       fill_full_set(w, h, buf->fd, buf->offset[0], buf->stride[0], all);
>>
>>         fill_one_missing(all, missing, EGL_HEIGHT);
>> -       pass = test_missing(fd, missing) && pass;
>> +       pass = test_missing(buf->fd, missing) && pass;
>>
>>         fill_one_missing(all, missing, EGL_WIDTH);
>> -       pass = test_missing(fd, missing) && pass;
>> +       pass = test_missing(buf->fd, missing) && pass;
>>
>>         fill_one_missing(all, missing, EGL_LINUX_DRM_FOURCC_EXT);
>> -       pass = test_missing(fd, missing) && pass;
>> +       pass = test_missing(buf->fd, missing) && pass;
>>
>>         fill_one_missing(all, missing, EGL_DMA_BUF_PLANE0_FD_EXT);
>> -       pass = test_missing(fd, missing) && pass;
>> +       pass = test_missing(buf->fd, missing) && pass;
>>
>>         fill_one_missing(all, missing, EGL_DMA_BUF_PLANE0_OFFSET_EXT);
>> -       pass = test_missing(fd, missing) && pass;
>> +       pass = test_missing(buf->fd, missing) && pass;
>>
>>         fill_one_missing(all, missing, EGL_DMA_BUF_PLANE0_PITCH_EXT);
>> -       pass = test_missing(fd, missing) && pass;
>> +       pass = test_missing(buf->fd, missing) && pass;
>>
>>         /**
>>          * EGL stack can claim the ownership of the file descriptor only
>> when it
>>          * succeeds. Close the file descriptor here and check that it
>> really
>>          * wasn't closed by EGL.
>>          */
>> -       pass = (close(fd) == 0) && pass;
>> +       pass = (close(buf->fd) == 0) && pass;
>>
>>         piglit_destroy_dma_buf(buf);
>>
>> diff --git a/tests/spec/ext_image_dma_buf_import/ownership_transfer.c
>> b/tests/spec/ext_image_dma_buf_import/ownership_transfer.c
>> index 2da455b..be5a044 100644
>> --- a/tests/spec/ext_image_dma_buf_import/ownership_transfer.c
>> +++ b/tests/spec/ext_image_dma_buf_import/ownership_transfer.c
>> @@ -23,6 +23,8 @@
>>
>>  #include <errno.h>
>>
>> +#include "piglit-framework-gl/piglit_drm_dma_buf.h"
>> +
>>  #include "image_common.h"
>>
>>  /**
>> @@ -113,19 +115,16 @@ piglit_display(void)
>>         const unsigned w = 2;
>>         const unsigned h = 2;
>>         const unsigned cpp = 4;
>> +       const unsigned fourcc = fourcc_code('A', 'R', '2', '4');;
>
>
> Why the custom fourcc? And two semicolons.

oh, cut/pasted that (badly, apparently) from one of the other tests
(refcnt?) until I realized that drm_fourcc.h was included somewhere.
I fixed up the rest of the tests but I guess I missed this one.

thx

BR,
-R


More information about the Piglit mailing list