[igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct

Swati Sharma swati2.sharma at intel.com
Tue Jan 24 10:51:53 UTC 2023



On 24-Jan-23 4:17 PM, Hogander, Jouni wrote:
> On Tue, 2023-01-24 at 12:21 +0530, Swati Sharma wrote:
>> Array can be used for plane_format. Use that and remove
>> struct.
>>
>> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
>> ---
>>   tests/i915/kms_dsc.c | 15 +++------------
>>   1 file changed, 3 insertions(+), 12 deletions(-)
>>
>> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
>> index af9466518..62df87636 100644
>> --- a/tests/i915/kms_dsc.c
>> +++ b/tests/i915/kms_dsc.c
>> @@ -52,16 +52,7 @@ typedef struct {
>>          enum pipe pipe;
>>   } data_t;
>>   
>> -const struct {
>> -       const int format;
>> -       const char format_str[20];
>> -} format_list[] = {
>> -       {DRM_FORMAT_XYUV8888, "XYUV8888"},
>> -       {DRM_FORMAT_XRGB2101010, "XRGB2101010"},
>> -       {DRM_FORMAT_XRGB16161616F, "XRGB16161616F"},
>> -       {DRM_FORMAT_YUYV, "YUYV"},
>> -};
>> -
>> +int format_list[] =  {DRM_FORMAT_XYUV8888, DRM_FORMAT_XRGB2101010,
>> DRM_FORMAT_XRGB16161616F, DRM_FORMAT_YUYV};
>>   uint32_t bpc_list[] = {12, 10, 8};
> 
> I think format_list should be static. Not matter of this patch, but
> maybe you could change bpc_list as a static too.
> 
Right, will make that change.

>>   
>>   static inline void manual(const char *expected)
>> @@ -242,7 +233,7 @@ igt_main
>>                       "with default parameters and creating fb with
>> diff formats");
>>          igt_subtest_with_dynamic("dsc-with-formats") {
>>                  for (int k = 0; k < ARRAY_SIZE(format_list); k++)
>> -                       test_dsc(&data, TEST_DSC_BASIC, 0,
>> format_list[k].format);
>> +                       test_dsc(&data, TEST_DSC_BASIC, 0,
>> format_list[k]);
>>          }
>>   
>>          igt_describe("Tests basic display stream compression
>> functionality if supported "
>> @@ -259,7 +250,7 @@ igt_main
>>          igt_subtest_with_dynamic("dsc-with-bpc-formats") {
>>                  for (int j = 0; j < ARRAY_SIZE(bpc_list); j++) {
>>                          for (int k = 0; k < ARRAY_SIZE(format_list);
>> k++) {
>> -                               test_dsc(&data, TEST_DSC_BPC,
>> bpc_list[j], format_list[k].format);
>> +                               test_dsc(&data, TEST_DSC_BPC,
>> bpc_list[j], format_list[k]);
>>                          }
>>                  }
>>          }
> 

-- 
~Swati Sharma


More information about the igt-dev mailing list