[PATCH 6/9] drm/ast: Add primary plane

Gerd Hoffmann kraxel at redhat.com
Tue Nov 5 09:51:02 UTC 2019


> +static const struct drm_plane_funcs ast_primary_plane_funcs = {
> +	.update_plane = drm_atomic_helper_update_plane,
> +	.disable_plane = drm_atomic_helper_disable_plane,
> +	.destroy = drm_plane_cleanup,
> +	.reset = drm_atomic_helper_plane_reset,
> +	.set_property = NULL,
> +	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
> +	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
> +	.atomic_set_property = NULL,
> +	.atomic_get_property = NULL,

It's not needed to explicitly set optional function pointers to NULL.

>  static const struct drm_encoder_helper_funcs ast_enc_helper_funcs = {
>  	.dpms = ast_encoder_dpms,
>  	.prepare = ast_encoder_prepare,
> @@ -976,10 +1045,33 @@ static void ast_cursor_fini(struct drm_device *dev)
>  
>  int ast_mode_init(struct drm_device *dev)
>  {
> +	static const uint32_t primary_plane_formats[] = {
> +		DRM_FORMAT_XRGB8888,
> +		DRM_FORMAT_RGB565,
> +		DRM_FORMAT_C8,
> +	};

I'd suggest to move this out of the function.

cheers,
  Gerd



More information about the dri-devel mailing list