Remove always true GLAMOR_HAS_DRM_* guards
With earlier commit the required version was bumped to 2.4.89, thus the
guards always evaluate to true.
Fixes: e4e3447603
("Add RandR leases with modesetting driver support
[v6]")
Cc: Keith Packard <keithp@keithp.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
e0748b10a8
commit
22b489d273
11
configure.ac
11
configure.ac
|
@ -2107,17 +2107,6 @@ if test "x$GLAMOR" = xyes; then
|
||||||
AC_MSG_ERROR([Glamor for Xorg requires $LIBGBM])
|
AC_MSG_ERROR([Glamor for Xorg requires $LIBGBM])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKG_CHECK_EXISTS(libdrm >= 2.4.62,
|
|
||||||
[AC_DEFINE(GLAMOR_HAS_DRM_ATOMIC, 1, [libdrm supports atomic API])],
|
|
||||||
[])
|
|
||||||
PKG_CHECK_EXISTS(libdrm >= 2.4.74,
|
|
||||||
[AC_DEFINE(GLAMOR_HAS_DRM_NAME_FROM_FD_2, 1, [Have GLAMOR_HAS_DRM_NAME_FROM_FD_2])],
|
|
||||||
[])
|
|
||||||
|
|
||||||
PKG_CHECK_EXISTS(libdrm >= 2.4.83,
|
|
||||||
[AC_DEFINE(GLAMOR_HAS_DRM_MODIFIERS, 1, [Have GLAMOR_HAS_DRM_MODIFIERS])],
|
|
||||||
[])
|
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes])
|
AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes])
|
||||||
|
|
||||||
|
|
|
@ -801,11 +801,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
|
||||||
/* To do DRI3 device FD generation, we need to open a new fd
|
/* To do DRI3 device FD generation, we need to open a new fd
|
||||||
* to the same device we were handed in originally.
|
* to the same device we were handed in originally.
|
||||||
*/
|
*/
|
||||||
#ifdef GLAMOR_HAS_DRM_NAME_FROM_FD_2
|
|
||||||
glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd);
|
glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd);
|
||||||
#else
|
|
||||||
glamor_egl->device_path = drmGetDeviceNameFromFd(glamor_egl->fd);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!dri3_screen_init(screen, &glamor_dri3_info)) {
|
if (!dri3_screen_init(screen, &glamor_dri3_info)) {
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
||||||
|
|
|
@ -1024,11 +1024,9 @@ PreInit(ScrnInfoPtr pScrn, int flags)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
|
ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
|
||||||
ret |= drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);
|
ret |= drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);
|
||||||
ms->atomic_modeset = (ret == 0);
|
ms->atomic_modeset = (ret == 0);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
|
if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n");
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n");
|
||||||
|
|
|
@ -58,8 +58,6 @@ static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int
|
||||||
int depth, int bitsPerPixel, int devKind,
|
int depth, int bitsPerPixel, int devKind,
|
||||||
void *pPixData);
|
void *pPixData);
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_MODIFIERS
|
|
||||||
|
|
||||||
static inline uint32_t *
|
static inline uint32_t *
|
||||||
formats_ptr(struct drm_format_modifier_blob *blob)
|
formats_ptr(struct drm_format_modifier_blob *blob)
|
||||||
{
|
{
|
||||||
|
@ -72,8 +70,6 @@ modifiers_ptr(struct drm_format_modifier_blob *blob)
|
||||||
return (struct drm_format_modifier *)(((char *)blob) + blob->modifiers_offset);
|
return (struct drm_format_modifier *)(((char *)blob) + blob->modifiers_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, uint64_t modifier)
|
drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, uint64_t modifier)
|
||||||
{
|
{
|
||||||
|
@ -392,7 +388,6 @@ drmmode_prop_info_free(drmmode_prop_info_ptr info, int num_props)
|
||||||
free(info[i].enum_values);
|
free(info[i].enum_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
static int
|
static int
|
||||||
plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc,
|
plane_add_prop(drmModeAtomicReq *req, drmmode_crtc_private_ptr drmmode_crtc,
|
||||||
enum drmmode_plane_property prop, uint64_t val)
|
enum drmmode_plane_property prop, uint64_t val)
|
||||||
|
@ -480,7 +475,6 @@ drm_mode_destroy(xf86CrtcPtr crtc, drmmode_mode_ptr mode)
|
||||||
xorg_list_del(&mode->entry);
|
xorg_list_del(&mode->entry);
|
||||||
free(mode);
|
free(mode);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drmmode_ConvertToKMode(ScrnInfoPtr scrn,
|
drmmode_ConvertToKMode(ScrnInfoPtr scrn,
|
||||||
|
@ -502,7 +496,6 @@ drmmode_crtc_set_fb(xf86CrtcPtr crtc, DisplayModePtr mode, uint32_t fb_id,
|
||||||
if (mode)
|
if (mode)
|
||||||
drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
|
drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
if (ms->atomic_modeset) {
|
if (ms->atomic_modeset) {
|
||||||
drmModeAtomicReq *req = drmModeAtomicAlloc();
|
drmModeAtomicReq *req = drmModeAtomicAlloc();
|
||||||
|
|
||||||
|
@ -566,7 +559,6 @@ drmmode_crtc_set_fb(xf86CrtcPtr crtc, DisplayModePtr mode, uint32_t fb_id,
|
||||||
drmModeAtomicFree(req);
|
drmModeAtomicFree(req);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
|
output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
|
||||||
if (!output_ids)
|
if (!output_ids)
|
||||||
|
@ -1638,15 +1630,14 @@ drmmode_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data)
|
||||||
static void
|
static void
|
||||||
drmmode_crtc_destroy(xf86CrtcPtr crtc)
|
drmmode_crtc_destroy(xf86CrtcPtr crtc)
|
||||||
{
|
{
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
drmmode_mode_ptr iterator, next;
|
drmmode_mode_ptr iterator, next;
|
||||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||||
|
|
||||||
|
// XXX: if (!...->atomic_modeset) return;
|
||||||
drmmode_prop_info_free(drmmode_crtc->props_plane, DRMMODE_PLANE__COUNT);
|
drmmode_prop_info_free(drmmode_crtc->props_plane, DRMMODE_PLANE__COUNT);
|
||||||
xorg_list_for_each_entry_safe(iterator, next, &drmmode_crtc->mode_list, entry) {
|
xorg_list_for_each_entry_safe(iterator, next, &drmmode_crtc->mode_list, entry) {
|
||||||
drm_mode_destroy(crtc, iterator);
|
drm_mode_destroy(crtc, iterator);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
|
static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
|
||||||
|
@ -1677,7 +1668,6 @@ drmmode_crtc_vblank_pipe(int crtc_id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
static Bool
|
static Bool
|
||||||
is_plane_assigned(ScrnInfoPtr scrn, int plane_id)
|
is_plane_assigned(ScrnInfoPtr scrn, int plane_id)
|
||||||
{
|
{
|
||||||
|
@ -1694,7 +1684,6 @@ is_plane_assigned(ScrnInfoPtr scrn, int plane_id)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_MODIFIERS
|
|
||||||
/**
|
/**
|
||||||
* Populates the formats array, and the modifiers of each format for a drm_plane.
|
* Populates the formats array, and the modifiers of each format for a drm_plane.
|
||||||
*/
|
*/
|
||||||
|
@ -1753,7 +1742,6 @@ populate_format_modifiers(xf86CrtcPtr crtc, const drmModePlane *kplane,
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num)
|
drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num)
|
||||||
|
@ -1884,12 +1872,11 @@ drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num)
|
||||||
drmmode_crtc->num_formats = best_kplane->count_formats;
|
drmmode_crtc->num_formats = best_kplane->count_formats;
|
||||||
drmmode_crtc->formats = calloc(sizeof(drmmode_format_rec),
|
drmmode_crtc->formats = calloc(sizeof(drmmode_format_rec),
|
||||||
best_kplane->count_formats);
|
best_kplane->count_formats);
|
||||||
#ifdef GLAMOR_HAS_DRM_MODIFIERS
|
// XXX: Runtime check modifiers_supported or it's implied by the successfull blob creation?
|
||||||
if (blob_id) {
|
if (blob_id) {
|
||||||
populate_format_modifiers(crtc, best_kplane, blob_id);
|
populate_format_modifiers(crtc, best_kplane, blob_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
for (i = 0; i < best_kplane->count_formats; i++)
|
for (i = 0; i < best_kplane->count_formats; i++)
|
||||||
drmmode_crtc->formats[i].format = best_kplane->formats[i];
|
drmmode_crtc->formats[i].format = best_kplane->formats[i];
|
||||||
|
@ -1900,7 +1887,6 @@ drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num)
|
||||||
drmmode_prop_info_free(tmp_props, DRMMODE_PLANE__COUNT);
|
drmmode_prop_info_free(tmp_props, DRMMODE_PLANE__COUNT);
|
||||||
drmModeFreePlaneResources(kplane_res);
|
drmModeFreePlaneResources(kplane_res);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res, int num)
|
drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res, int num)
|
||||||
|
@ -1908,13 +1894,11 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
|
||||||
xf86CrtcPtr crtc;
|
xf86CrtcPtr crtc;
|
||||||
drmmode_crtc_private_ptr drmmode_crtc;
|
drmmode_crtc_private_ptr drmmode_crtc;
|
||||||
modesettingEntPtr ms_ent = ms_ent_priv(pScrn);
|
modesettingEntPtr ms_ent = ms_ent_priv(pScrn);
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
drmModeObjectPropertiesPtr props;
|
drmModeObjectPropertiesPtr props;
|
||||||
static const drmmode_prop_info_rec crtc_props[] = {
|
static const drmmode_prop_info_rec crtc_props[] = {
|
||||||
[DRMMODE_CRTC_ACTIVE] = { .name = "ACTIVE" },
|
[DRMMODE_CRTC_ACTIVE] = { .name = "ACTIVE" },
|
||||||
[DRMMODE_CRTC_MODE_ID] = { .name = "MODE_ID" },
|
[DRMMODE_CRTC_MODE_ID] = { .name = "MODE_ID" },
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs);
|
crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs);
|
||||||
if (crtc == NULL)
|
if (crtc == NULL)
|
||||||
|
@ -1927,7 +1911,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
|
||||||
drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num);
|
drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num);
|
||||||
xorg_list_init(&drmmode_crtc->mode_list);
|
xorg_list_init(&drmmode_crtc->mode_list);
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
// XXX: if (...->atomic_modeset) {
|
||||||
props = drmModeObjectGetProperties(drmmode->fd, mode_res->crtcs[num],
|
props = drmModeObjectGetProperties(drmmode->fd, mode_res->crtcs[num],
|
||||||
DRM_MODE_OBJECT_CRTC);
|
DRM_MODE_OBJECT_CRTC);
|
||||||
if (!props || !drmmode_prop_info_copy(drmmode_crtc->props, crtc_props,
|
if (!props || !drmmode_prop_info_copy(drmmode_crtc->props, crtc_props,
|
||||||
|
@ -1940,7 +1924,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
|
||||||
DRMMODE_CRTC__COUNT, props);
|
DRMMODE_CRTC__COUNT, props);
|
||||||
drmModeFreeObjectProperties(props);
|
drmModeFreeObjectProperties(props);
|
||||||
drmmode_crtc_create_planes(crtc, num);
|
drmmode_crtc_create_planes(crtc, num);
|
||||||
#endif
|
// XXX: }
|
||||||
|
|
||||||
/* Hide any cursors which may be active from previous users */
|
/* Hide any cursors which may be active from previous users */
|
||||||
drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0);
|
drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0);
|
||||||
|
@ -2082,7 +2066,6 @@ koutput_get_prop_idx(int fd, drmModeConnectorPtr koutput,
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
static int
|
static int
|
||||||
koutput_get_prop_id(int fd, drmModeConnectorPtr koutput,
|
koutput_get_prop_id(int fd, drmModeConnectorPtr koutput,
|
||||||
int type, const char *name)
|
int type, const char *name)
|
||||||
|
@ -2091,7 +2074,6 @@ koutput_get_prop_id(int fd, drmModeConnectorPtr koutput,
|
||||||
|
|
||||||
return (idx > -1) ? koutput->props[idx] : -1;
|
return (idx > -1) ? koutput->props[idx] : -1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static drmModePropertyBlobPtr
|
static drmModePropertyBlobPtr
|
||||||
koutput_get_prop_blob(int fd, drmModeConnectorPtr koutput, const char *name)
|
koutput_get_prop_blob(int fd, drmModeConnectorPtr koutput, const char *name)
|
||||||
|
@ -2263,19 +2245,17 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
|
||||||
drmmode_output_private_ptr drmmode_output = output->driver_private;
|
drmmode_output_private_ptr drmmode_output = output->driver_private;
|
||||||
xf86CrtcPtr crtc = output->crtc;
|
xf86CrtcPtr crtc = output->crtc;
|
||||||
drmModeConnectorPtr koutput = drmmode_output->mode_output;
|
drmModeConnectorPtr koutput = drmmode_output->mode_output;
|
||||||
#ifndef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
drmmode_ptr drmmode = drmmode_output->drmmode;
|
drmmode_ptr drmmode = drmmode_output->drmmode;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!koutput)
|
if (!koutput)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
// XXX: if (...->atomic_modeset) {
|
||||||
drmmode_output->dpms = mode;
|
drmmode_output->dpms = mode;
|
||||||
#else
|
// XXX: } else {
|
||||||
drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id,
|
drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id,
|
||||||
drmmode_output->dpms_enum_id, mode);
|
drmmode_output->dpms_enum_id, mode);
|
||||||
#endif
|
// XXX: }
|
||||||
|
|
||||||
if (crtc) {
|
if (crtc) {
|
||||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||||
|
@ -2624,12 +2604,10 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
|
||||||
Bool nonDesktop = FALSE;
|
Bool nonDesktop = FALSE;
|
||||||
drmModePropertyBlobPtr path_blob = NULL;
|
drmModePropertyBlobPtr path_blob = NULL;
|
||||||
const char *s;
|
const char *s;
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
drmModeObjectPropertiesPtr props;
|
drmModeObjectPropertiesPtr props;
|
||||||
static const drmmode_prop_info_rec connector_props[] = {
|
static const drmmode_prop_info_rec connector_props[] = {
|
||||||
[DRMMODE_CONNECTOR_CRTC_ID] = { .name = "CRTC_ID", },
|
[DRMMODE_CONNECTOR_CRTC_ID] = { .name = "CRTC_ID", },
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
koutput =
|
koutput =
|
||||||
drmModeGetConnector(drmmode->fd, mode_res->connectors[num]);
|
drmModeGetConnector(drmmode->fd, mode_res->connectors[num]);
|
||||||
|
@ -2718,7 +2696,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
|
||||||
/* work out the possible clones later */
|
/* work out the possible clones later */
|
||||||
output->possible_clones = 0;
|
output->possible_clones = 0;
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
// XXX: if (...->atomic_modeset) {
|
||||||
if (!drmmode_prop_info_copy(drmmode_output->props_connector, connector_props,
|
if (!drmmode_prop_info_copy(drmmode_output->props_connector, connector_props,
|
||||||
DRMMODE_CONNECTOR__COUNT, 0)) {
|
DRMMODE_CONNECTOR__COUNT, 0)) {
|
||||||
goto out_free_encoders;
|
goto out_free_encoders;
|
||||||
|
@ -2728,10 +2706,10 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
|
||||||
DRM_MODE_OBJECT_CONNECTOR);
|
DRM_MODE_OBJECT_CONNECTOR);
|
||||||
drmmode_prop_info_update(drmmode, drmmode_output->props_connector,
|
drmmode_prop_info_update(drmmode, drmmode_output->props_connector,
|
||||||
DRMMODE_CONNECTOR__COUNT, props);
|
DRMMODE_CONNECTOR__COUNT, props);
|
||||||
#else
|
// XXX: } else {
|
||||||
drmmode_output->dpms_enum_id =
|
drmmode_output->dpms_enum_id =
|
||||||
koutput_get_prop_id(drmmode->fd, koutput, DRM_MODE_PROP_ENUM, "DPMS");
|
koutput_get_prop_id(drmmode->fd, koutput, DRM_MODE_PROP_ENUM, "DPMS");
|
||||||
#endif
|
// XXX: }
|
||||||
|
|
||||||
if (dynamic)
|
if (dynamic)
|
||||||
output->randr_output = RROutputCreate(xf86ScrnToScreen(pScrn), output->name, strlen(output->name), output);
|
output->randr_output = RROutputCreate(xf86ScrnToScreen(pScrn), output->name, strlen(output->name), output);
|
||||||
|
|
|
@ -165,13 +165,11 @@ do_queue_flip_on_crtc(modesettingPtr ms, xf86CrtcPtr crtc,
|
||||||
{
|
{
|
||||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
if (ms->atomic_modeset) {
|
if (ms->atomic_modeset) {
|
||||||
flags |= DRM_MODE_ATOMIC_NONBLOCK;
|
flags |= DRM_MODE_ATOMIC_NONBLOCK;
|
||||||
return drmmode_crtc_set_fb(crtc, NULL, ms->drmmode.fb_id, 0, 0, flags,
|
return drmmode_crtc_set_fb(crtc, NULL, ms->drmmode.fb_id, 0, 0, flags,
|
||||||
(void *) (uintptr_t) seq);
|
(void *) (uintptr_t) seq);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return drmModePageFlip(ms->fd, drmmode_crtc->mode_crtc->crtc_id,
|
return drmModePageFlip(ms->fd, drmmode_crtc->mode_crtc->crtc_id,
|
||||||
ms->drmmode.fb_id, flags,
|
ms->drmmode.fb_id, flags,
|
||||||
|
|
|
@ -223,9 +223,7 @@ ms_present_check_flip(RRCrtcPtr crtc,
|
||||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||||
int num_crtcs_on = 0;
|
int num_crtcs_on = 0;
|
||||||
int i;
|
int i;
|
||||||
#ifdef GLAMOR_HAS_DRM_MODIFIERS
|
|
||||||
struct gbm_bo *gbm;
|
struct gbm_bo *gbm;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!ms->drmmode.pageflip)
|
if (!ms->drmmode.pageflip)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -256,7 +254,8 @@ ms_present_check_flip(RRCrtcPtr crtc,
|
||||||
pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo))
|
pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#ifdef GLAMOR_HAS_DRM_MODIFIERS
|
// XXX: Runtime check modifiers_supported?
|
||||||
|
#ifdef GBM_BO_WITH_MODIFIERS
|
||||||
/* Check if buffer format/modifier is supported by all active CRTCs */
|
/* Check if buffer format/modifier is supported by all active CRTCs */
|
||||||
gbm = glamor_gbm_bo_from_pixmap(screen, pixmap);
|
gbm = glamor_gbm_bo_from_pixmap(screen, pixmap);
|
||||||
if (gbm) {
|
if (gbm) {
|
||||||
|
|
|
@ -491,15 +491,6 @@
|
||||||
/* GBM has modifiers support */
|
/* GBM has modifiers support */
|
||||||
#undef GBM_BO_WITH_MODIFIERS
|
#undef GBM_BO_WITH_MODIFIERS
|
||||||
|
|
||||||
/* Build glamor use new drmGetDeviceNameFromFD2 */
|
|
||||||
#undef GLAMOR_HAS_DRM_NAME_FROM_FD_2
|
|
||||||
|
|
||||||
/* Glamor should use atomic DRM API */
|
|
||||||
#undef GLAMOR_HAS_DRM_ATOMIC
|
|
||||||
|
|
||||||
/* Glamor can retrieve supported DRM formats/modifiers */
|
|
||||||
#undef GLAMOR_HAS_DRM_MODIFIERS
|
|
||||||
|
|
||||||
/* Glamor can use eglQueryDmaBuf* functions */
|
/* Glamor can use eglQueryDmaBuf* functions */
|
||||||
#undef GLAMOR_HAS_EGL_QUERY_DMABUF
|
#undef GLAMOR_HAS_EGL_QUERY_DMABUF
|
||||||
|
|
||||||
|
|
|
@ -73,12 +73,6 @@ conf_data.set_quoted('SHMDIR', '/tmp')
|
||||||
|
|
||||||
conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found())
|
conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found())
|
||||||
conf_data.set('WITH_LIBDRM', libdrm_dep.found())
|
conf_data.set('WITH_LIBDRM', libdrm_dep.found())
|
||||||
conf_data.set('GLAMOR_HAS_DRM_ATOMIC',
|
|
||||||
libdrm_dep.found() and libdrm_dep.version().version_compare('>= 2.4.62'))
|
|
||||||
conf_data.set('GLAMOR_HAS_DRM_NAME_FROM_FD_2',
|
|
||||||
libdrm_dep.found() and libdrm_dep.version().version_compare('>= 2.4.74'))
|
|
||||||
conf_data.set('GLAMOR_HAS_DRM_MODIFIERS',
|
|
||||||
libdrm_dep.found() and libdrm_dep.version().version_compare('>= 2.4.83'))
|
|
||||||
conf_data.set('GLAMOR_HAS_EGL_QUERY_DMABUF',
|
conf_data.set('GLAMOR_HAS_EGL_QUERY_DMABUF',
|
||||||
epoxy_dep.found() and epoxy_dep.version().version_compare('>= 1.4.4'))
|
epoxy_dep.found() and epoxy_dep.version().version_compare('>= 1.4.4'))
|
||||||
conf_data.set('GLXEXT', build_glx)
|
conf_data.set('GLXEXT', build_glx)
|
||||||
|
|
Loading…
Reference in New Issue