~emersion/vaapi-decoder

db20653e6d8f8358c7e7a6134cb72fd9e1184770 — Simon Ser 9 months ago 8c32666 kms-modifiers
Use modifiers
1 files changed, 8 insertions(+), 6 deletions(-)

M main.c
M main.c => main.c +8 -6
@@ 193,9 193,10 @@ static uint32_t import_drm_frame_desc(const AVDRMFrameDescriptor *drm_frame_desc
	}
	fprintf(stderr, "DRM format: 0x%X\n", drm_format);

	uint32_t handles[4];
	uint32_t pitches[4];
	uint32_t offsets[4];
	uint32_t handles[4] = {0};
	uint32_t pitches[4] = {0};
	uint32_t offsets[4] = {0};
	uint64_t modifiers[4] = {0};
	int k = 0;
	for (int i = 0; i < drm_frame_desc->nb_layers; i++) {
		const AVDRMLayerDescriptor *drm_layer = &drm_frame_desc->layers[i];


@@ 213,15 214,16 @@ static uint32_t import_drm_frame_desc(const AVDRMFrameDescriptor *drm_frame_desc
			handles[k] = handle;
			pitches[k] = drm_plane->pitch;
			offsets[k] = drm_plane->offset;
			modifiers[k] = drm_object->format_modifier;
			k++;
		}
	}

	uint32_t fb_id = 0;
	int ret = drmModeAddFB2(drm_fd, width, height, drm_format,
		handles, pitches, offsets, &fb_id, 0);
	int ret = drmModeAddFB2WithModifiers(drm_fd, width, height, drm_format,
		handles, pitches, offsets, modifiers, &fb_id, DRM_MODE_FB_MODIFIERS);
	if (ret < 0) {
		perror("drmModeAddFB2");
		perror("drmModeAddFB2WithModifiers");
		return 0;
	}