mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-25 23:45:58 +01:00
screencast: add fallback for linear modifier
This commit is contained in:
parent
2366b4d415
commit
78dee83d77
2 changed files with 9 additions and 0 deletions
|
@ -241,6 +241,9 @@ static void pwr_handle_stream_param_changed(void *data, uint32_t id,
|
||||||
flags = cast->ctx->state->config->screencast_conf.force_mod_linear ?
|
flags = cast->ctx->state->config->screencast_conf.force_mod_linear ?
|
||||||
GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR : GBM_BO_USE_RENDERING;
|
GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR : GBM_BO_USE_RENDERING;
|
||||||
break;
|
break;
|
||||||
|
case DRM_FORMAT_MOD_LINEAR:
|
||||||
|
flags = GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,12 @@ struct xdpw_buffer *xdpw_buffer_create(struct xdpw_screencast_instance *cast,
|
||||||
frame_info->format, flags);
|
frame_info->format, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fallback for linear buffers via the implicit api
|
||||||
|
if (buffer->bo == NULL && cast->pwr_format.modifier == DRM_FORMAT_MOD_LINEAR) {
|
||||||
|
buffer->bo = gbm_bo_create(cast->ctx->gbm, frame_info->width, frame_info->height,
|
||||||
|
frame_info->format, flags | GBM_BO_USE_LINEAR);
|
||||||
|
}
|
||||||
|
|
||||||
if (buffer->bo == NULL) {
|
if (buffer->bo == NULL) {
|
||||||
logprint(ERROR, "xdpw: failed to create gbm_bo");
|
logprint(ERROR, "xdpw: failed to create gbm_bo");
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
Loading…
Reference in a new issue