[igt-dev] [PATCH i-g-t] i915/kms_fbcon_fbt: Add crct_id to struct

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Apr 6 09:04:03 UTC 2023


Hi Swati,

On 2023-03-31 at 12:44:26 +0530, Swati Sharma wrote:

may you change patch description from subject ? I would like
to see there something like you wrote below, for example:

i915/kms_fbcon_fbt: remove hard-coding of PIPE_A for CRC calc

> Remove hard-coding of PIPE_A while computing CRC.

You can write here how you did it (added crtc_id to drm_info
struct) but imho it is not needed.

Please also test it again as CI didn't tested it.

Regards,
Kamil

> 
> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
> ---
>  tests/i915/kms_fbcon_fbt.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/i915/kms_fbcon_fbt.c b/tests/i915/kms_fbcon_fbt.c
> index 831ec867a..6c557dca7 100644
> --- a/tests/i915/kms_fbcon_fbt.c
> +++ b/tests/i915/kms_fbcon_fbt.c
> @@ -39,7 +39,7 @@ IGT_TEST_DESCRIPTION("Test the relationship between fbcon and the frontbuffer "
>  #define MAX_CONNECTORS 32
>  
>  struct drm_info {
> -	int fd, debugfs_fd;
> +	int fd, debugfs_fd, crtc_id;
>  	struct igt_fb fb;
>  	drmModeResPtr res;
>  	drmModeConnectorPtr connectors[MAX_CONNECTORS];
> @@ -117,9 +117,10 @@ static bool fbc_check_cursor_blinking(struct drm_info *drm)
>  	igt_pipe_crc_t *pipe_crc;
>  	igt_crc_t crc[2];
>  	bool ret;
> -	int i;
> +	int i, pipe;
>  
> -	pipe_crc = igt_pipe_crc_new(drm->fd, PIPE_A, IGT_PIPE_CRC_SOURCE_AUTO);
> +	pipe = kmstest_get_pipe_from_crtc_id(drm->fd, drm->crtc_id);
> +	pipe_crc = igt_pipe_crc_new(drm->fd, pipe, IGT_PIPE_CRC_SOURCE_AUTO);
>  
>  	igt_pipe_crc_start(pipe_crc);
>  	igt_pipe_crc_drain(pipe_crc);
> @@ -165,7 +166,6 @@ static void set_mode_for_one_screen(struct drm_info *drm,
>  				    connector_possible_fn connector_possible)
>  {
>  	int i, rc;
> -	uint32_t crtc_id;
>  	drmModeModeInfoPtr mode;
>  	uint32_t buffer_id;
>  	drmModeConnectorPtr c = NULL;
> @@ -182,7 +182,7 @@ static void set_mode_for_one_screen(struct drm_info *drm,
>  	igt_require_f(i < drm->res->count_connectors,
>  		      "No connector available\n");
>  
> -	crtc_id = kmstest_find_crtc_for_connector(drm->fd, drm->res, c, 0);
> +	drm->crtc_id = kmstest_find_crtc_for_connector(drm->fd, drm->res, c, 0);
>  
>  	buffer_id = igt_create_fb(drm->fd, mode->hdisplay, mode->vdisplay,
>  				  DRM_FORMAT_XRGB8888,
> @@ -193,7 +193,7 @@ static void set_mode_for_one_screen(struct drm_info *drm,
>  		 mode->hdisplay, mode->vdisplay,
>  		 kmstest_connector_type_str(c->connector_type));
>  
> -	rc = drmModeSetCrtc(drm->fd, crtc_id, buffer_id, 0, 0,
> +	rc = drmModeSetCrtc(drm->fd, drm->crtc_id, buffer_id, 0, 0,
>  			    &c->connector_id, 1, mode);
>  	igt_assert_eq(rc, 0);
>  }
> -- 
> 2.25.1
> 


More information about the igt-dev mailing list