Message ID | 1430819603-492-2-git-send-email-tvrtko.ursulin@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> @@ -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. 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? > > plane->fb_changed = true; > -- > 2.3.5
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
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 33d437d..b5ba273 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -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; } plane->fb_changed = true;