[Intel-gfx] [PATCH i-g-t 2/4] igt_kms: Merge condition in igt_plane_set_fb

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu May 7 02:06:28 PDT 2015


On 05/06/2015 09:56 PM, Konduru, Chandra wrote:
>> @@ -1765,14 +1765,6 @@ void igt_plane_set_fb(igt_plane_t *plane, struct
>> igt_fb *fb)
>>   	plane->fb = fb;
>>   	/* hack to keep tests working that don't call igt_plane_set_size() */
>>   	if (fb) {
>> -		plane->crtc_w = fb->width;
>> -		plane->crtc_h = fb->height;
>> -	} else {
>> -		plane->crtc_w = 0;
>> -		plane->crtc_h = 0;
>> -	}
>> -
>> -	if (fb) {
>>   		/* set default plane pos/size as fb size */
>>   		plane->crtc_x = 0;
>>   		plane->crtc_y = 0;
>> @@ -1784,6 +1776,9 @@ void igt_plane_set_fb(igt_plane_t *plane, struct
>> igt_fb *fb)
>>   		fb->src_y = 0;
>>   		fb->src_w = fb->width;
>>   		fb->src_h = fb->height;
>> +	} else {
>> +		plane->crtc_w = 0;
>> +		plane->crtc_h = 0;
>>   	}
> Existing code is simply setting fb src position and plane crtc position to 0s (top left)
> and src size as fb size and crtc size as plane size to start a fb with a plane. Then individual
> test can change them to whatever fb position/size and plane position/size as it wants.
> As I commented to 3/4 patch, if these initializations are removed, then all tests to be
> updated to explicitly set them.

Not sure what you mean. I simply cleaned two "if (fb)" conditions one 
after another, into one. No functional changes.

> As a side note, is there any reason for having two patches 2/4 and 3/4 modifying
> same lines of code instead of a single patch?

Because this is just a code cleanup and the other was a functional 
change. And because it doesn't matter - lets not spend hours going back 
and forth on trivial IGT fixes.

Regards,

Tvrtko


More information about the Intel-gfx mailing list