__DRI_IMAGE_COMPONENTS_Y_UV, PIPE_FORMAT_NV12 },
{ __DRI_IMAGE_FOURCC_YUYV, __DRI_IMAGE_FORMAT_YUYV,
__DRI_IMAGE_COMPONENTS_Y_XUXV, PIPE_FORMAT_YUYV },
+ { __DRI_IMAGE_FOURCC_UYVY, __DRI_IMAGE_FORMAT_UYVY,
+ __DRI_IMAGE_COMPONENTS_Y_UXVX, PIPE_FORMAT_UYVY },
};
static const struct dri2_format_mapping *
-dri2_get_mapping_by_fourcc(int fourcc) {
+dri2_get_mapping_by_fourcc(int fourcc)
+{
for (unsigned i = 0; i < ARRAY_SIZE(dri2_format_table); i++) {
if (dri2_format_table[i].dri_fourcc == fourcc)
- return &dri2_format_table[i];
+ return &dri2_format_table[i];
}
return NULL;
}
static const struct dri2_format_mapping *
-dri2_get_mapping_by_format(int format) {
+dri2_get_mapping_by_format(int format)
+{
for (unsigned i = 0; i < ARRAY_SIZE(dri2_format_table); i++) {
if (dri2_format_table[i].dri_format == format)
- return &dri2_format_table[i];
+ return &dri2_format_table[i];
}
return NULL;
if (!map)
return NULL;
- /* createImageWithModifiers doesn't supply usage, and we should not get
- * here with both modifiers and a usage flag.
- */
- assert(!(use && (modifiers != NULL)));
-
tex_usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
if (use & __DRI_IMAGE_USE_SCANOUT)
void *loaderPrivate)
{
return dri2_create_image_common(dri_screen, width, height, format,
- 0 /* use */, modifiers, count,
+ __DRI_IMAGE_USE_SHARE, modifiers, count,
loaderPrivate);
}
const __DRIconfig **configs;
struct dri_screen *screen;
struct pipe_screen *pscreen = NULL;
- const struct drm_conf_ret *throttle_ret;
- const struct drm_conf_ret *dmabuf_ret;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
if (!pscreen)
goto release_pipe;
- throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
- dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD);
-
- if (throttle_ret && throttle_ret->val.val_int != -1) {
- screen->throttling_enabled = TRUE;
- screen->default_throttle_frames = throttle_ret->val.val_int;
- }
+ screen->default_throttle_frames =
+ pscreen->get_param(pscreen, PIPE_CAP_MAX_FRAMES_IN_FLIGHT);
if (pscreen->resource_create_with_modifiers)
dri2ImageExtension.createImageWithModifiers =
dri2_create_image_with_modifiers;
- if (dmabuf_ret && dmabuf_ret->val.val_bool) {
+ if (pscreen->get_param(pscreen, PIPE_CAP_DMABUF)) {
uint64_t cap;
if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, &cap) == 0 &&