diff mbox

[i-g-t,v3,6/6] kms_panel_fitting: Enable connectors with "scaling mode" property set.

Message ID 1461701492-9975-7-git-send-email-robert.foss@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Robert Foss April 26, 2016, 8:11 p.m. UTC
From: Robert Foss <robert.foss@collabora.com>

Enable testing on all connectors that have the "scaling mode"
property set.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
---
 tests/kms_panel_fitting.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

Comments

Jani Nikula April 27, 2016, 8:32 a.m. UTC | #1
On Tue, 26 Apr 2016, robert.foss@collabora.com wrote:
> From: Robert Foss <robert.foss@collabora.com>
>
> Enable testing on all connectors that have the "scaling mode"
> property set.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93012

>
> Signed-off-by: Robert Foss <robert.foss@collabora.com>
> ---
>  tests/kms_panel_fitting.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
> index 272a531..de27803 100644
> --- a/tests/kms_panel_fitting.c
> +++ b/tests/kms_panel_fitting.c
> @@ -139,9 +139,21 @@ 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)
> +		uint32_t prop_id;
> +		uint64_t prop_value;
> +		drmModePropertyPtr prop_ptr;
> +		bool scaling_mode_set;
> +
> +		scaling_mode_set = kmstest_get_property(d->drm_fd,
> +			output->config.connector->connector_id,
> +			DRM_MODE_OBJECT_CONNECTOR,
> +			"scaling mode",
> +			&prop_id,
> +			&prop_value,
> +			&prop_ptr);
> +
> +		/* Check that the "scaling mode" property has been set. */
> +		if (!scaling_mode_set)
>  			continue;
>  
>  		pipe = output->config.pipe;
Ville Syrjälä April 27, 2016, 10:37 a.m. UTC | #2
On Tue, Apr 26, 2016 at 04:11:32PM -0400, robert.foss@collabora.com wrote:
> From: Robert Foss <robert.foss@collabora.com>
> 
> Enable testing on all connectors that have the "scaling mode"
> property set.
> 
> Signed-off-by: Robert Foss <robert.foss@collabora.com>
> ---
>  tests/kms_panel_fitting.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
> index 272a531..de27803 100644
> --- a/tests/kms_panel_fitting.c
> +++ b/tests/kms_panel_fitting.c
> @@ -139,9 +139,21 @@ 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)
> +		uint32_t prop_id;
> +		uint64_t prop_value;
> +		drmModePropertyPtr prop_ptr;
> +		bool scaling_mode_set;
> +
> +		scaling_mode_set = kmstest_get_property(d->drm_fd,
> +			output->config.connector->connector_id,
> +			DRM_MODE_OBJECT_CONNECTOR,
> +			"scaling mode",
> +			&prop_id,
> +			&prop_value,
> +			&prop_ptr);

I think you can just pass NULL for all the out paramters since you're
not using them. As a bonus that'll plug the memory leak you have now.

> +
> +		/* Check that the "scaling mode" property has been set. */
> +		if (!scaling_mode_set)
>  			continue;
>  
>  		pipe = output->config.pipe;
> -- 
> 2.5.0
diff mbox

Patch

diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index 272a531..de27803 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -139,9 +139,21 @@  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)
+		uint32_t prop_id;
+		uint64_t prop_value;
+		drmModePropertyPtr prop_ptr;
+		bool scaling_mode_set;
+
+		scaling_mode_set = kmstest_get_property(d->drm_fd,
+			output->config.connector->connector_id,
+			DRM_MODE_OBJECT_CONNECTOR,
+			"scaling mode",
+			&prop_id,
+			&prop_value,
+			&prop_ptr);
+
+		/* Check that the "scaling mode" property has been set. */
+		if (!scaling_mode_set)
 			continue;
 
 		pipe = output->config.pipe;