[PATCH 3/4] drm/imx: add FB modifier support

Daniel Stone daniel at fooishbar.org
Wed May 3 17:15:04 UTC 2017


Hi Lucas,

On 3 May 2017 at 17:28, Lucas Stach <l.stach at pengutronix.de> wrote:
>         int available_pres = ipu_prg_max_active_channels();
>         int i;
>
> +       /*
> +        * We are going over the planes in 2 passes: first we assign PREs to
> +        * planes with a tiling modifier, which need the PREs to resolve into
> +        * linear. Any failure to assign a PRE there is fatal. In the second
> +        * pass we try to assign PREs to linear FBs, to improve memory access
> +        * patterns for them. Failure at this point is non-fatal, as we can
> +        * scan out linear FBs without a PRE.
> +        */
>         for_each_plane_in_state(state, plane, plane_state, i) {
> -               struct ipu_plane_state *ipu_state =
> -                               to_ipu_plane_state(plane_state);
> -               struct ipu_plane *ipu_plane = to_ipu_plane(plane);
> +               ipu_state = to_ipu_plane_state(plane_state);
> +               ipu_plane = to_ipu_plane(plane);
> +
> +               if (!plane_state->fb) {
> +                       ipu_state->use_pre = false;
> +                       continue;
> +               }
> +
> +               if (!(plane_state->fb->flags & DRM_MODE_FB_MODIFIERS) ||
> +                   plane_state->fb->modifier == DRM_FORMAT_MOD_LINEAR)
> +                       continue;
> +
> +               if (!ipu_prg_present(ipu_plane->ipu) || !available_pres)
> +                       return -EINVAL;

What about planes which aren't present in this commit, but are still
taking up a PRE unit? Will they have their PRE stolen, or am I missing
something?

Cheers,
Daniel


More information about the dri-devel mailing list