mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-05 13:29:47 -05:00
Merge branch 'master' into screencontent
This commit is contained in:
commit
21928cbe61
39 changed files with 163 additions and 144 deletions
|
|
@ -255,7 +255,7 @@ static uint32_t drm_connector_get_gamma_size(struct wlr_output *output) {
|
|||
}
|
||||
|
||||
static bool drm_connector_export_dmabuf(struct wlr_output *output,
|
||||
struct wlr_dmabuf_buffer_attribs *attribs) {
|
||||
struct wlr_dmabuf_attributes *attribs) {
|
||||
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
|
||||
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
|
||||
|
||||
|
|
|
|||
|
|
@ -160,23 +160,22 @@ void post_drm_surface(struct wlr_drm_surface *surf) {
|
|||
}
|
||||
}
|
||||
|
||||
bool export_drm_bo(struct gbm_bo *bo,
|
||||
struct wlr_dmabuf_buffer_attribs *attribs) {
|
||||
memset(attribs, 0, sizeof(struct wlr_dmabuf_buffer_attribs));
|
||||
bool export_drm_bo(struct gbm_bo *bo, struct wlr_dmabuf_attributes *attribs) {
|
||||
memset(attribs, 0, sizeof(struct wlr_dmabuf_attributes));
|
||||
|
||||
attribs->n_planes = gbm_bo_get_plane_count(bo);
|
||||
if (attribs->n_planes > WLR_LINUX_DMABUF_MAX_PLANES) {
|
||||
if (attribs->n_planes > WLR_DMABUF_MAX_PLANES) {
|
||||
return false;
|
||||
}
|
||||
|
||||
attribs->width = gbm_bo_get_width(bo);
|
||||
attribs->height = gbm_bo_get_height(bo);
|
||||
attribs->format = gbm_bo_get_format(bo);
|
||||
attribs->modifier = gbm_bo_get_modifier(bo);
|
||||
|
||||
for (int i = 0; i < attribs->n_planes; ++i) {
|
||||
attribs->offset[i] = gbm_bo_get_offset(bo, i);
|
||||
attribs->stride[i] = gbm_bo_get_stride_for_plane(bo, i);
|
||||
attribs->modifier[i] = gbm_bo_get_modifier(bo);
|
||||
attribs->fd[i] = gbm_bo_get_fd(bo);
|
||||
if (attribs->fd[i] < 0) {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
|
|
@ -215,7 +214,7 @@ static struct wlr_texture *get_tex_for_bo(struct wlr_drm_renderer *renderer,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct wlr_dmabuf_buffer_attribs attribs;
|
||||
struct wlr_dmabuf_attributes attribs;
|
||||
if (!export_drm_bo(bo, &attribs)) {
|
||||
free(tex);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue