[PATCH libdrm 19/25] tests: tegra: Add VIC 3.0 support

Michał Mirosław mirq-linux at rere.qmqm.pl
Fri Aug 27 14:06:02 UTC 2021


On Fri, Aug 27, 2021 at 03:22:59PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding at nvidia.com>
> 
> The Video Image Composer (VIC) 3.0 can be found on NVIDIA Tegra124 SoCs.a
[...]
> +static int vic30_clear(struct vic *v, struct vic_image *output,
> +                       unsigned int alpha, unsigned int red,
> +                       unsigned int green, unsigned int blue)
> +{
> +    struct vic30 *vic = container_of(v, struct vic30, base);
> +    ConfigStruct *c;
> +    int err;
> +
> +    err = drm_tegra_bo_map(vic->config.bo, (void **)&c);
> +    if (err < 0) {
> +        fprintf(stderr, "failed to map configuration structure: %s\n",
> +                strerror(-err));
> +        return err;
> +    }
> +
> +    memset(c, 0, sizeof(*c));
> +
> +    c->surfaceList0Struct.TargetRectLeft = 0;
> +    c->surfaceList0Struct.TargetRectTop = 0;
> +    c->surfaceList0Struct.TargetRectRight = output->width - 1;
> +    c->surfaceList0Struct.TargetRectBottom = output->height - 1;
> +
> +    c->blending0Struct.PixelFormat = output->format;
> +    c->blending0Struct.BackgroundAlpha = alpha;
> +    c->blending0Struct.BackgroundR = red;
> +    c->blending0Struct.BackgroundG = green;
> +    c->blending0Struct.BackgroundB = blue;
> +    c->blending0Struct.LumaWidth = output->stride - 1;
> +    c->blending0Struct.LumaHeight = output->height - 1;
> +    c->blending0Struct.ChromaWidth = 16383;
> +    c->blending0Struct.ChromaHeight = 16383;
> +    c->blending0Struct.TargetRectLeft = 0;
> +    c->blending0Struct.TargetRectTop = 0;
> +    c->blending0Struct.TargetRectRight = output->width - 1;
> +    c->blending0Struct.TargetRectBottom = output->height - 1;
> +    c->blending0Struct.SurfaceWidth = output->width - 1;
> +    c->blending0Struct.SurfaceHeight = output->height - 1;
> +    c->blending0Struct.BlkKind = output->kind;
> +    c->blending0Struct.BlkHeight = 0;
> +
> +    c->fetchControl0Struct.TargetRectLeft = 0;
> +    c->fetchControl0Struct.TargetRectTop = 0;
> +    c->fetchControl0Struct.TargetRectRight = output->width - 1;
> +    c->fetchControl0Struct.TargetRectBottom = output->height - 1;
> +
> +    drm_tegra_bo_unmap(vic->config.bo);
> +
> +    return 0;
> +}
[...]

It does look exactly like:

return vic30_fill(v, output, 0, 0, output->width - 1,
	output->height - 1, alpha, red, green, blue);

Best Regards
Michał Mirosław


More information about the dri-devel mailing list