Lines Matching refs:vic
28 #include "vic.h"
32 struct vic base;
45 static int vic42_fill(struct vic *v, struct vic_image *output,
51 struct vic42 *vic = container_of(v, struct vic42, base);
55 err = drm_tegra_bo_map(vic->config.bo, (void **)&c);
83 drm_tegra_bo_unmap(vic->config.bo);
88 static int vic42_blit(struct vic *v, struct vic_image *output,
91 struct vic42 *vic = container_of(v, struct vic42, base);
97 err = drm_tegra_bo_map(vic->config.bo, (void **)&c);
152 drm_tegra_bo_unmap(vic->config.bo);
157 static int vic42_flip(struct vic *v, struct vic_image *output,
160 struct vic42 *vic = container_of(v, struct vic42, base);
166 err = drm_tegra_bo_map(vic->config.bo, (void **)&c);
222 drm_tegra_bo_unmap(vic->config.bo);
227 static int vic42_execute(struct vic *v, struct drm_tegra_pushbuf *pushbuf,
231 struct vic42 *vic = container_of(v, struct vic42, base);
239 VIC_PUSH_BUFFER(pushbuf, ptrp, NVC5B6_VIDEO_COMPOSITOR_SET_CONFIG_STRUCT_OFFSET, vic->config.map, 0, 0);
240 VIC_PUSH_BUFFER(pushbuf, ptrp, NVC5B6_VIDEO_COMPOSITOR_SET_FILTER_STRUCT_OFFSET, vic->filter.map, 0, 0);
254 static void vic42_free(struct vic *v)
256 struct vic42 *vic = container_of(v, struct vic42, base);
258 drm_tegra_channel_unmap(vic->filter.map);
259 drm_tegra_bo_unref(vic->filter.bo);
261 drm_tegra_channel_unmap(vic->config.map);
262 drm_tegra_bo_unref(vic->config.bo);
266 free(vic);
278 struct vic **vicp)
280 struct vic42 *vic;
284 vic = calloc(1, sizeof(*vic));
285 if (!vic)
288 vic->base.drm = drm;
289 vic->base.channel = channel;
290 vic->base.ops = &vic42_ops;
291 vic->base.version = 0x19;
293 err = drm_tegra_syncpoint_new(drm, &vic->base.syncpt);
299 err = drm_tegra_bo_new(drm, 0, 16384, &vic->config.bo);
306 err = drm_tegra_channel_map(channel, vic->config.bo, DRM_TEGRA_CHANNEL_MAP_READ,
307 &vic->config.map);
314 err = drm_tegra_bo_new(drm, 0, 16384, &vic->filter.bo);
321 err = drm_tegra_bo_map(vic->filter.bo, &ptr);
328 drm_tegra_bo_unmap(vic->filter.bo);
330 err = drm_tegra_channel_map(channel, vic->filter.bo, DRM_TEGRA_CHANNEL_MAP_READ,
331 &vic->filter.map);
339 *vicp = &vic->base;