Skip to content

Commit

Permalink
src/mirror-dmabuf: add some useful dmabuf debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferdi265 committed Oct 24, 2023
1 parent 589ddbc commit 3143b97
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/mirror-dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ static void on_frame(
backend->dmabuf.drm_format = format;
backend->dmabuf.planes = num_objects;

log_debug(ctx, "mirror-dmabuf::on_frame(): w=%d h=%d gl_format=%x drm_format=%08x drm_modifier=%016lx\n",
backend->dmabuf.width, backend->dmabuf.height, GL_RGB8_OES, backend->dmabuf.drm_format, backend->dmabuf_modifier
);

for (size_t i = 0; i < num_objects; i++) {
backend->dmabuf.fds[i] = -1;
}
Expand All @@ -125,7 +129,9 @@ static void on_object(
ctx_t * ctx = (ctx_t *)data;
dmabuf_mirror_backend_t * backend = (dmabuf_mirror_backend_t *)ctx->mirror.backend;

log_debug(ctx, "mirror-dmabuf::on_object(): received %d byte object with plane_index %d\n", size, plane_index);
log_debug(ctx, "mirror-dmabuf::on_object(): fd=%d offset=% 10d stride=% 10d\n",
fd, offset, stride
);
if (backend->state != STATE_WAIT_OBJECTS) {
log_error("mirror-dmabuf::on_object(): got object while in state %d\n", backend->state);
close(fd);
Expand All @@ -138,6 +144,7 @@ static void on_object(
return;
}


backend->dmabuf.fds[index] = fd;
backend->dmabuf.offsets[index] = offset;
backend->dmabuf.strides[index] = stride;
Expand All @@ -149,6 +156,8 @@ static void on_object(
}

(void)frame;
(void)size;
(void)plane_index;
}

static void on_ready(
Expand Down

0 comments on commit 3143b97

Please sign in to comment.