summaryrefslogtreecommitdiff
path: root/lib/igt_fb.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@bootlin.com>2019-02-08 14:18:52 +0100
committerPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-02-11 10:53:07 +0100
commitad6e1dbe7cd38539df2ed73f02292fcfa8bc157b (patch)
tree388340075a66d93f1c7cd9e755ec41550b92391e /lib/igt_fb.c
parent947301563259726b65ce47d3a3fe37931ed42efe (diff)
igt: fb: Refactor dumb buffer allocation path
The else condition is not needed, since all the other conditions return when they are done. Move the KMS dumb buffer allocation outside of the outer else condition, this will also allow to ease later changes. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r--lib/igt_fb.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 5d8c187a..c61e6805 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -559,15 +559,14 @@ static int create_bo_for_fb(struct igt_fb *fb)
igt_require(driver_has_gem_api);
return -EINVAL;
}
- } else {
- fb->is_dumb = true;
+ }
- fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height,
- fb->plane_bpp[0],
- &fb->strides[0], &fb->size);
+ fb->is_dumb = true;
+ fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height,
+ fb->plane_bpp[0],
+ &fb->strides[0], &fb->size);
- return fb->gem_handle;
- }
+ return fb->gem_handle;
}
/**