Skip to contentSkip to conversation

Improve kms_panel_fitting.

PATCH Superseded [email protected] 3 participants 12 messages Apr 25, 2016 – Apr 26, 2016

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover Improve kms_panel_fitting.

From: Robert Foss <[email protected]>

Changes since v1:
- Squash patches
- Based patch on https://lists.freedesktop.org/archives/intel-gfx/2016-March/090617.html

Robert Foss (6):
kms_panel_fitting: Remove un-read variable.
kms_panel_fitting: Remove un-read variable pipe_crc.
kms_panel_fitting: Remove un-used variable.
kms_panel_fitting: Switched DRM format to a hardware agnostic
alternative.
kms_panel_fitting: Enabled test on non-Intel hardware.
kms_panel_fitting: Add support for LVDS and DSI connectors.

 tests/kms_panel_fitting.c | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v2 1/6 kms_panel_fitting: Remove un-read variable.

From: Robert Foss <[email protected]>

Remove devid from data_t since it is never read.
Also remove one assignment to devid.

---
 tests/kms_panel_fitting.c | 2 --
 1 file changed, 2 deletions(-)
tests/kms_panel_fitting.c +0 -2
index 1f9412f..43ad770 100644
@@ -29,7 +29,6 @@
 IGT_TEST_DESCRIPTION("Test display panel fitting");
 
 typedef struct {
-	uint32_t devid;
 	int drm_fd;
 	igt_display_t display;
 	igt_crc_t ref_crc;
@@ -225,7 +224,6 @@ igt_simple_main
 	data.drm_fd = drm_open_driver(DRIVER_INTEL);
 	igt_require_pipe_crc();
 	igt_display_init(&data.display, data.drm_fd);
-	data.devid = intel_get_drm_devid(data.drm_fd);
 
 	test_panel_fitting(&data);
 
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v2 2/6 kms_panel_fitting: Remove un-read variable pipe_crc.

In reply to [email protected]

From: Robert Foss <[email protected]>

pipe_crc in data_t is assigned an allocated memory space and then later free'd. But it is never used for any comparisons. It should therefore be safe to remove pipe_crc and the crc requirement.

---
 tests/kms_panel_fitting.c | 9 ---------
 1 file changed, 9 deletions(-)
tests/kms_panel_fitting.c +0 -9
index 43ad770..7bfd980 100644
@@ -32,7 +32,6 @@ typedef struct {
 	int drm_fd;
 	igt_display_t display;
 	igt_crc_t ref_crc;
-	igt_pipe_crc_t *pipe_crc;
 
 	int image_w;
 	int image_h;
@@ -59,10 +58,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 
 	igt_output_set_pipe(output, pipe);
 
-	/* create the pipe_crc object for this pipe */
-	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-
 	/* before allocating, free if any older fb */
 	if (data->fb_id1) {
 		igt_remove_fb(data->drm_fd, &data->fb1);
@@ -109,9 +104,6 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
 {
 	igt_display_t *display = &data->display;
 
-	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = NULL;
-
 	if (data->fb_id1) {
 		igt_remove_fb(data->drm_fd, &data->fb1);
 		data->fb_id1 = 0;
@@ -222,7 +214,6 @@ igt_simple_main
 	igt_skip_on_simulation();
 
 	data.drm_fd = drm_open_driver(DRIVER_INTEL);
-	igt_require_pipe_crc();
 	igt_display_init(&data.display, data.drm_fd);
 
 	test_panel_fitting(&data);
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH v2 3/6 kms_panel_fitting: Remove un-used variable.

In reply to [email protected]

From: Robert Foss <[email protected]>

ref_crc is never assigned or read, and can be safely removed.

---
 tests/kms_panel_fitting.c | 1 -
 1 file changed, 1 deletion(-)
tests/kms_panel_fitting.c +0 -1
index 7bfd980..099816b 100644
@@ -31,7 +31,6 @@ IGT_TEST_DESCRIPTION("Test display panel fitting");
 typedef struct {
 	int drm_fd;
 	igt_display_t display;
-	igt_crc_t ref_crc;
 
 	int image_w;
 	int image_h;
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH v2 4/6 kms_panel_fitting: Switched DRM format to a hardware agnostic alternative.

In reply to [email protected]

From: Robert Foss <[email protected]>

Changed the DRM format to LOCAL_DRM_FORMAT_MOD_NONE since it is hardware agnostic.

Also fixed formatting/tabs.

---
 tests/kms_panel_fitting.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tests/kms_panel_fitting.c +5 -5
index 099816b..427bfc6 100644
@@ -65,10 +65,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 
 	/* allocate fb for plane 1 */
 	data->fb_id1 = igt_create_pattern_fb(data->drm_fd,
-					     mode->hdisplay, mode->vdisplay,
-					     DRM_FORMAT_XRGB8888,
-					     LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
-					     &data->fb1);
+						mode->hdisplay, mode->vdisplay,
+						DRM_FORMAT_XRGB8888,
+						LOCAL_DRM_FORMAT_MOD_NONE,
+						&data->fb1);
 	igt_assert(data->fb_id1);
 
 	/*
@@ -159,7 +159,7 @@ static void test_panel_fitting(data_t *d)
 
 		d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0,
 						DRM_FORMAT_XRGB8888,
-						LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
+						LOCAL_DRM_FORMAT_MOD_NONE,
 						FILE_NAME, &d->fb2);
 		igt_assert(d->fb_id2);
 
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH v2 5/6 kms_panel_fitting: Enabled test on non-Intel hardware.

In reply to [email protected]

From: Robert Foss <[email protected]>

Switched from DRIVER_INTEL to DRIVER_ANY to enable test on all hardware.

---
 tests/kms_panel_fitting.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/kms_panel_fitting.c +1 -1
index 427bfc6..272a531 100644
@@ -212,7 +212,7 @@ igt_simple_main
 
 	igt_skip_on_simulation();
 
-	data.drm_fd = drm_open_driver(DRIVER_INTEL);
+	data.drm_fd = drm_open_driver(DRIVER_ANY);
 	igt_display_init(&data.display, data.drm_fd);
 
 	test_panel_fitting(&data);
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH v2 6/6 kms_panel_fitting: Add support for LVDS and DSI connectors.

In reply to [email protected]

From: Robert Foss <[email protected]>

Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors.

---
 tests/kms_panel_fitting.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
tests/kms_panel_fitting.c +10 -3
index 272a531..f59d042 100644
@@ -140,9 +140,16 @@ static void test_panel_fitting(data_t *d)
 	for_each_connected_output(display, output) {
 		drmModeModeInfo *mode, native_mode;
 
-		if (output->config.connector->connector_type !=
-		    DRM_MODE_CONNECTOR_eDP)
-			continue;
+		/* Ignore over incompatible connectors. */
+		switch (output->config.connector->connector_type)
+		{
+			case DRM_MODE_CONNECTOR_LVDS:
+			case DRM_MODE_CONNECTOR_eDP:
+			case DRM_MODE_CONNECTOR_DSI:
+				break;
+			default:
+				continue;
+		}
 
 		pipe = output->config.pipe;
 		igt_output_set_pipe(output, pipe);
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Re: [PATCH i-g-t v2 6/6] kms_panel_fitting: Add support for LVDS and DSI connectors.

Quoted 21 lines · On Mon, Apr 25, 2016 at 10:35:51AM -0400, [email protected] wrote:

From: Robert Foss <[email protected]>

Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors.

---
 tests/kms_panel_fitting.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
tests/kms_panel_fitting.c +0 -3
index 272a531..f59d042 100644
@@ -140,9 +140,16 @@ static void test_panel_fitting(data_t *d)
 	for_each_connected_output(display, output) {
 		drmModeModeInfo *mode, native_mode;
 
-		if (output->config.connector->connector_type !=
-		    DRM_MODE_CONNECTOR_eDP)
-			continue;

tests/kms_panel_fitting.c static void test_panel_fitting(data_t *d) · line 152

Quoted 10 lines
tests/kms_panel_fitting.c +10 -0
+		/* Ignore over incompatible connectors. */
+		switch (output->config.connector->connector_type)
+		{
+			case DRM_MODE_CONNECTOR_LVDS:
+			case DRM_MODE_CONNECTOR_eDP:
+			case DRM_MODE_CONNECTOR_DSI:
+				break;
+			default:
+				continue;
+		}

What happened to looking for the property?

Quoted 10 lines
tests/kms_panel_fitting.c +0 -0
 		pipe = output->config.pipe;
 		igt_output_set_pipe(output, pipe);
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

Re: [PATCH i-g-t v2 6/6] kms_panel_fitting: Add support for LVDS and DSI connectors.

Quoted 19 lines · Ville Syrjälä
Quoted 18 lines · On Mon, Apr 25, 2016 at 10:35:51AM -0400, [email protected] wrote:

From: Robert Foss <[email protected]>

Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors.

---
  tests/kms_panel_fitting.c | 13 ++++++++++---
  1 file changed, 10 insertions(+), 3 deletions(-)
tests/kms_panel_fitting.c +0 -0
index 272a531..f59d042 100644
@@ -140,9 +140,16 @@ static void test_panel_fitting(data_t *d)
  	for_each_connected_output(display, output) {
  		drmModeModeInfo *mode, native_mode;
 
Quoted 14 lines

tests/kms_panel_fitting.c static void test_panel_fitting(data_t *d) · line 152

Quoted 13 lines
tests/kms_panel_fitting.c +10 -3
-		if (output->config.connector->connector_type !=
-		    DRM_MODE_CONNECTOR_eDP)
-			continue;
+		/* Ignore over incompatible connectors. */
+		switch (output->config.connector->connector_type)
+		{
+			case DRM_MODE_CONNECTOR_LVDS:
+			case DRM_MODE_CONNECTOR_eDP:
+			case DRM_MODE_CONNECTOR_DSI:
+				break;
+			default:
+				continue;
+		}

What happened to looking for the property?

The "scaling mode" property? I was intentionally leaving it out. If desired, I could look into adding that too.

I've looked for and not found the "scaling mode" property id, but I still haven't found it. Do you know what it is?

Quoted 11 lines
Quoted 11 lines
tests/kms_panel_fitting.c +0 -0
  		pipe = output->config.pipe;
  		igt_output_set_pipe(output, pipe);
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw

Re: [PATCH i-g-t v2 6/6] kms_panel_fitting: Add support for LVDS and DSI connectors.

Quoted 36 lines · Robert Foss
Quoted 19 lines · Ville Syrjälä
Quoted 18 lines · On Mon, Apr 25, 2016 at 10:35:51AM -0400, [email protected] wrote:

From: Robert Foss <[email protected]>

Add support for DRM_MODE_CONNECTOR_LVDS and DRM_MODE_CONNECTOR_DSI connectors.

---
  tests/kms_panel_fitting.c | 13 ++++++++++---
  1 file changed, 10 insertions(+), 3 deletions(-)
tests/kms_panel_fitting.c +0 -0
index 272a531..f59d042 100644
@@ -140,9 +140,16 @@ static void test_panel_fitting(data_t *d)
  	for_each_connected_output(display, output) {
  		drmModeModeInfo *mode, native_mode;
 
Quoted 14 lines

tests/kms_panel_fitting.c static void test_panel_fitting(data_t *d) · line 152

Quoted 13 lines
tests/kms_panel_fitting.c +10 -3
-		if (output->config.connector->connector_type !=
-		    DRM_MODE_CONNECTOR_eDP)
-			continue;
+		/* Ignore over incompatible connectors. */
+		switch (output->config.connector->connector_type)
+		{
+			case DRM_MODE_CONNECTOR_LVDS:
+			case DRM_MODE_CONNECTOR_eDP:
+			case DRM_MODE_CONNECTOR_DSI:
+				break;
+			default:
+				continue;
+		}

What happened to looking for the property?

Quoted 6 lines

The "scaling mode" property? I was intentionally leaving it out. If desired, I could look into adding that too.

I've looked for and not found the "scaling mode" property id, but I still haven't found it.
Do you know what it is?

drm object ids are assigned at runtime, so they're not something you can hardcode anywhere. Instead you'll need to do the lookup based on the property name.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
tests/kms_panel_fitting.c +0 -0
  		pipe = output->config.pipe;
  		igt_output_set_pipe(output, pipe);
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
In reply to [email protected]
Quoted 6 lines · On 25 April 2016 at 16:35, <[email protected]> wrote:

From: Robert Foss <[email protected]>

Changes since v1:
- Squash patches
- Based patch on https://lists.freedesktop.org/archives/intel-gfx/2016-March/090617.html

Thanks for the patches, you can add my Reviewed-by tag to all except the 6th patch, about which I don't know enough.

Tomeu

Quoted 12 lines

Robert Foss (6):
kms_panel_fitting: Remove un-read variable.
kms_panel_fitting: Remove un-read variable pipe_crc.
kms_panel_fitting: Remove un-used variable.
kms_panel_fitting: Switched DRM format to a hardware agnostic
alternative.
kms_panel_fitting: Enabled test on non-Intel hardware.
kms_panel_fitting: Add support for LVDS and DSI connectors.

 tests/kms_panel_fitting.c | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)
Quoted 7 lines

--
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw
Quoted 9 lines
Quoted 3 lines

Changes since v1:
- Squash patches
- Based patch on https://lists.freedesktop.org/archives/intel-gfx/2016-March/090617.html

Thanks for the patches, you can add my Reviewed-by tag to all except the 6th patch, about which I don't know enough.

Tomeu

Thank you, I will submit the next version later today.
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx