summaryrefslogtreecommitdiff
path: root/tests/kms_panel_fitting.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-01-18 12:54:07 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-02-05 13:41:02 +0100
commit2646ae1d5c83c550995b3d10683eb57707f714d6 (patch)
tree0f357c55c2a11d4d30f47b8e878dfedae5d7f026 /tests/kms_panel_fitting.c
parentba7acd3f118452da41149efb1fe503347f04a77a (diff)
tests/kms_panel_fitting: Remove dead code
fb3 is unused, and fb_id1/2 are also set in igt_framebuffer, so it doesn't need separate member values. image_w/h are also unused and create_fb will always succeed, so more elimination of dead code. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'tests/kms_panel_fitting.c')
-rw-r--r--tests/kms_panel_fitting.c52
1 files changed, 16 insertions, 36 deletions
diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index e4ea3556..e0ca6cca 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -32,15 +32,8 @@ typedef struct {
int drm_fd;
igt_display_t display;
- int image_w;
- int image_h;
-
struct igt_fb fb1;
struct igt_fb fb2;
- struct igt_fb fb3;
- int fb_id1;
- int fb_id2;
- int fb_id3;
igt_plane_t *plane1;
igt_plane_t *plane2;
@@ -58,18 +51,17 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
igt_output_set_pipe(output, pipe);
/* before allocating, free if any older fb */
- if (data->fb_id1) {
+ if (data->fb1.fb_id) {
igt_remove_fb(data->drm_fd, &data->fb1);
- data->fb_id1 = 0;
+ data->fb1.fb_id = 0;
}
/* allocate fb for plane 1 */
- data->fb_id1 = igt_create_pattern_fb(data->drm_fd,
- mode->hdisplay, mode->vdisplay,
- DRM_FORMAT_XRGB8888,
- LOCAL_DRM_FORMAT_MOD_NONE,
- &data->fb1);
- igt_assert(data->fb_id1);
+ igt_create_pattern_fb(data->drm_fd,
+ mode->hdisplay, mode->vdisplay,
+ DRM_FORMAT_XRGB8888,
+ LOCAL_DRM_FORMAT_MOD_NONE,
+ &data->fb1);
/*
* We always set the primary plane to actually enable the pipe as
@@ -91,17 +83,13 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
{
igt_display_t *display = &data->display;
- if (data->fb_id1) {
+ if (data->fb1.fb_id) {
igt_remove_fb(data->drm_fd, &data->fb1);
- data->fb_id1 = 0;
+ data->fb1.fb_id = 0;
}
- if (data->fb_id2) {
+ if (data->fb2.fb_id) {
igt_remove_fb(data->drm_fd, &data->fb2);
- data->fb_id2 = 0;
- }
- if (data->fb_id3) {
- igt_remove_fb(data->drm_fd, &data->fb3);
- data->fb_id3 = 0;
+ data->fb2.fb_id = 0;
}
if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
@@ -121,7 +109,6 @@ static void test_panel_fitting(data_t *d)
{
igt_display_t *display = &d->display;
igt_output_t *output;
- cairo_surface_t *image;
enum pipe pipe;
int valid_tests = 0;
@@ -146,18 +133,11 @@ static void test_panel_fitting(data_t *d)
mode = igt_output_get_mode(output);
native_mode = *mode;
- /* allocate fb2 with image size */
- image = igt_cairo_image_surface_create_from_png(FILE_NAME);
- igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
- d->image_w = cairo_image_surface_get_width(image);
- d->image_h = cairo_image_surface_get_height(image);
- cairo_surface_destroy(image);
-
- d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0,
- DRM_FORMAT_XRGB8888,
- LOCAL_DRM_FORMAT_MOD_NONE,
- FILE_NAME, &d->fb2);
- igt_assert(d->fb_id2);
+ /* allocate fb2 with image */
+ igt_create_image_fb(d->drm_fd, 0, 0,
+ DRM_FORMAT_XRGB8888,
+ LOCAL_DRM_FORMAT_MOD_NONE,
+ FILE_NAME, &d->fb2);
/* Set up display to enable panel fitting */
mode->hdisplay = 640;