Skip to content

Commit

Permalink
Add missing ifdefs for screencopy-dmabuf
Browse files Browse the repository at this point in the history
  • Loading branch information
any1 committed Nov 10, 2024
1 parent 3ec4650 commit 9737ecb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ext-image-copy-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,11 @@ static double rate_format(const struct ext_image_copy_capture* self,
enum wv_buffer_type type, enum wv_buffer_domain domain,
uint32_t format, uint64_t modifier)
{
#ifdef ENABLE_SCREENCOPY_DMABUF
if (type == WV_BUFFER_DMABUF && !self->parent.enable_linux_dmabuf) {
return 0;
}
#endif
return self->parent.rate_format(self->parent.userdata, type, domain,
format, modifier);
}
Expand All @@ -359,6 +361,7 @@ static void rate_formats_in_array(const struct ext_image_copy_capture* self,
}
}

#ifdef ENABLE_SCREENCOPY_DMABUF
static void select_modifiers_for_top_format(struct wv_buffer_config* config,
const struct format_array* formats)
{
Expand All @@ -378,6 +381,7 @@ static void select_modifiers_for_top_format(struct wv_buffer_config* config,
config->modifiers[config->n_modifiers++] = entry->modifier;
}
}
#endif

static bool config_dma_buffers(struct ext_image_copy_capture* self,
struct wv_buffer_config* config)
Expand Down
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1609,9 +1609,11 @@ static double rate_format(const void* userdata, enum wv_buffer_type type,
case WV_BUFFER_SHM:
fb_type = NVNC_FB_SIMPLE;
break;
#ifdef ENABLE_SCREENCOPY_DMABUF
case WV_BUFFER_DMABUF:
fb_type = NVNC_FB_GBM_BO;
break;
#endif
case WV_BUFFER_UNSPEC:;
}
assert(fb_type != NVNC_FB_UNSPEC);
Expand Down

0 comments on commit 9737ecb

Please sign in to comment.