[igt-dev] [PATCH i-g-t v2 1/2] lib/igt_kms: added tile property parser

Ser, Simon simon.ser at intel.com
Tue Aug 27 07:33:45 UTC 2019


On Fri, 2019-08-23 at 11:23 -0700, Madhumitha Tolakanahalli Pradeep wrote:
> The tile property parser parses the connector tile property obtained
> from connector's Display ID block and set per connector.
> 
> v2: Minor style changes (Simon)
> 
> Cc: Manasi Navare <manasi.d.navare at intel.com>
> Cc: Petri Latvala <petri.latvala at intel.com>
> Cc: Simon Ser <simon.ser at intel.com>
> 
> Cc: <madhumitha.tp at gmail.com>
> 
> Signed-off-by: Madhumitha Tolakanahalli Pradeep <madhumitha.tolakanahalli.pradeep at intel.com>

This is still:

Reviewed-by: Simon Ser <simon.ser at intel.com>

> ---
>  lib/igt_kms.c | 29 +++++++++++++++++++++++++++++
>  lib/igt_kms.h | 11 +++++++++++
>  2 files changed, 40 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 17a7d2b6..dc0f810d 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -4515,3 +4515,32 @@ bool igt_display_has_format_mod(igt_display_t *display, uint32_t format,
>  
>  	return false;
>  }
> +
> +/**
> + * igt_parse_connector_tile_blob:
> + * @blob: pointer to the connector's tile properties
> + * @tile: pointer to tile structure that is populated by the function
> + *
> + * Parses the connector tile blob to extract the tile information.
> + * The blob information is exposed from drm/drm_connector.c in the kernel.
> + * The format of the tile property is defined in the kernel as char tile[256]
> + * that consists of 8 integers that are ':' separated.
> + *
> + */
> +
> +void igt_parse_connector_tile_blob(drmModePropertyBlobPtr blob,
> +		igt_tile_info_t *tile)
> +{
> +	char *blob_data = blob->data;
> +
> +	igt_assert(blob);
> +
> +	tile->tile_group_id = atoi(strtok(blob_data, ":"));
> +	tile->tile_is_single_monitor = atoi(strtok(NULL, ":"));
> +	tile->num_h_tile = atoi(strtok(NULL, ":"));
> +	tile->num_v_tile = atoi(strtok(NULL, ":"));
> +	tile->tile_h_loc = atoi(strtok(NULL, ":"));
> +	tile->tile_v_loc = atoi(strtok(NULL, ":"));
> +	tile->tile_h_size = atoi(strtok(NULL, ":"));
> +	tile->tile_v_size = atoi(strtok(NULL, ":"));
> +}
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 56481fd1..aebb4d31 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -390,6 +390,14 @@ struct igt_display {
>  	int format_mod_count;
>  };
>  
> +typedef struct {
> +	int tile_group_id;
> +	bool tile_is_single_monitor;
> +	uint8_t num_h_tile, num_v_tile;
> +	uint8_t tile_h_loc, tile_v_loc;
> +	uint16_t tile_h_size, tile_v_size;
> +} igt_tile_info_t;
> +
>  void igt_display_require(igt_display_t *display, int drm_fd);
>  void igt_display_fini(igt_display_t *display);
>  void igt_display_reset(igt_display_t *display);
> @@ -834,4 +842,7 @@ static inline bool igt_vblank_before(uint32_t a, uint32_t b)
>  	return igt_vblank_after(b, a);
>  }
>  
> +void igt_parse_connector_tile_blob(drmModePropertyBlobPtr blob,
> +		igt_tile_info_t *tile);
> +
>  #endif /* __IGT_KMS_H__ */


More information about the igt-dev mailing list