[Intel-gfx] [PATCH i-g-t 07/10] igt_kms: Remove pan members from igt_plane

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Thu Jun 30 12:57:16 UTC 2016


They're duplicates with src_x/y, so just use those.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 lib/igt_kms.c             | 24 ++++--------------------
 lib/igt_kms.h             |  4 ----
 tests/kms_panel_fitting.c |  2 +-
 tests/kms_plane.c         |  8 +++-----
 tests/kms_plane_scaling.c |  2 +-
 5 files changed, 9 insertions(+), 31 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index eefdc74af1a6..64abd341e8e5 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1908,7 +1908,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 	igt_assert(!primary->rotation_changed);
 
 	if (!primary->fb_changed && !primary->position_changed &&
-		!primary->size_changed && !primary->panning_changed)
+		!primary->size_changed)
 		return 0;
 
 	crtc_id = pipe->crtc_id;
@@ -1920,18 +1920,18 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 
 	if (fb_id) {
 		LOG(display,
-		    "%s: SetCrtc pipe %s, fb %u, panning (%d, %d), "
+		    "%s: SetCrtc pipe %s, fb %u, src (%d, %d), "
 		    "mode %dx%d\n",
 		    igt_output_name(output),
 		    kmstest_pipe_name(pipe->pipe),
 		    fb_id,
-		    primary->pan_x, primary->pan_y,
+		    primary->src_x, primary->src_x,
 		    mode->hdisplay, mode->vdisplay);
 
 		ret = drmModeSetCrtc(display->drm_fd,
 				     crtc_id,
 				     fb_id,
-				     primary->pan_x, primary->pan_y,
+				     primary->src_x, primary->src_x,
 				     &output->id,
 				     1,
 				     mode);
@@ -1955,7 +1955,6 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 	primary->fb_changed = false;
 	primary->position_changed = false;
 	primary->size_changed = false;
-	primary->panning_changed = false;
 
 	return 0;
 }
@@ -2401,21 +2400,6 @@ void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
 	plane->fb_changed = true;
 }
 
-void igt_plane_set_panning(igt_plane_t *plane, int x, int y)
-{
-	igt_pipe_t *pipe = plane->pipe;
-	igt_display_t *display = pipe->display;
-
-	LOG(display, "%s.%d: plane_set_panning(%d,%d)\n",
-	    kmstest_pipe_name(pipe->pipe),
-	    plane->index, x, y);
-
-	plane->pan_x = x;
-	plane->pan_y = y;
-
-	plane->panning_changed = true;
-}
-
 static const char *rotation_name(igt_rotation_t rotation)
 {
 	switch (rotation) {
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 718af11fa333..2c88c1be61e4 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -214,7 +214,6 @@ typedef struct {
 	/* state tracking */
 	unsigned int fb_changed       : 1;
 	unsigned int position_changed : 1;
-	unsigned int panning_changed  : 1;
 	unsigned int rotation_changed : 1;
 	unsigned int size_changed     : 1;
 	/*
@@ -238,8 +237,6 @@ typedef struct {
 	uint32_t src_w;
 	uint32_t src_h;
 
-	/* panning offset within the fb */
-	unsigned int pan_x, pan_y;
 	igt_rotation_t rotation;
 	uint32_t atomic_props_plane[IGT_NUM_PLANE_PROPS];
 } igt_plane_t;
@@ -320,7 +317,6 @@ void igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);
 void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb);
 void igt_plane_set_position(igt_plane_t *plane, int x, int y);
 void igt_plane_set_size(igt_plane_t *plane, int w, int h);
-void igt_plane_set_panning(igt_plane_t *plane, int x, int y);
 void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation);
 void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background);
 void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane,
diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index b796c6812679..f858cef6a947 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -89,7 +89,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 		ret = drmModeSetCrtc(data->drm_fd,
 				output->config.crtc->crtc_id,
 				data->fb_id1,
-				plane->pan_x, plane->pan_y,
+				plane->src_x, plane->src_y,
 				&output->id,
 				1,
 				mode);
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 60b8d71d52d4..56c9d8d8c0ea 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -321,11 +321,9 @@ test_plane_panning_with_output(data_t *data,
 	igt_plane_set_fb(primary, &primary_fb);
 
 	if (flags & TEST_PANNING_TOP_LEFT)
-		igt_plane_set_panning(primary, 0, 0);
+		igt_fb_set_position(primary, &primary_fb, 0, 0);
 	else
-		igt_plane_set_panning(primary, mode->hdisplay, mode->vdisplay);
-
-	igt_plane_set_position(primary, 0, 0);
+		igt_fb_set_position(primary, &primary_fb, mode->hdisplay, mode->vdisplay);
 
 	igt_display_commit(&data->display);
 
@@ -343,7 +341,7 @@ test_plane_panning_with_output(data_t *data,
 
 	/* reset states to neutral values, assumed by other tests */
 	igt_output_set_pipe(output, PIPE_ANY);
-	igt_plane_set_panning(primary, 0, 0);
+	igt_fb_set_position(&primary_fb, primary, 0, 0);
 
 	test_fini(data);
 }
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index ad5404d90bfa..855670857c18 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -98,7 +98,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 		ret = drmModeSetCrtc(data->drm_fd,
 				output->config.crtc->crtc_id,
 				data->fb_id1,
-				plane->pan_x, plane->pan_y,
+				plane->src_x, plane->src_y,
 				&output->id,
 				1,
 				mode);
-- 
2.5.5



More information about the Intel-gfx mailing list