Commits (7)
noinst_LTLIBRARIES = libdri3.la
AM_CFLAGS = \
-DHAVE_XORG_CONFIG_H \
@DIX_CFLAGS@ @XORG_CFLAGS@
@DIX_CFLAGS@
libdri3_la_SOURCES = \
dri3.h \
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "dri3_priv.h"
#include <drm_fourcc.h>
......
......@@ -23,6 +23,7 @@
#ifndef _DRI3PRIV_H_
#define _DRI3PRIV_H_
#include "dix-config.h"
#include <X11/X.h>
#include "scrnintstr.h"
#include "misc.h"
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "dri3_priv.h"
#include <syncsrv.h>
#include <unistd.h>
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "dri3_priv.h"
#include <syncsdk.h>
#include <misync.h>
......
......@@ -14,7 +14,6 @@ if build_dri3
srcs_dri3,
include_directories: inc,
dependencies: [ common_dep, libdrm_dep ],
c_args: '-DHAVE_XORG_CONFIG_H'
)
endif
......
......@@ -41,7 +41,7 @@
#include "glamor_transfer.h"
#include <X11/extensions/Xv.h>
#include "../hw/xfree86/common/fourcc.h"
#include <fourcc.h>
/* Reference color space transform data */
typedef struct tagREF_TRANSFORM {
float RefLuma;
......
......@@ -13,7 +13,6 @@ KDRIVE_XV_SOURCES = \
endif
libkdrive_la_SOURCES = \
fourcc.h \
kcmap.c \
kdrive.c \
kdrive.h \
......
/*
This header file contains listings of STANDARD guids for video formats.
Please do not place non-registered, or incomplete entries in this file.
A list of some popular fourcc's are at: http://www.webartz.com/fourcc/
For an explanation of fourcc <-> guid mappings see RFC2361.
*/
#ifndef _XF86_FOURCC_H_
#define _XF86_FOURCC_H_ 1
#define FOURCC_YUY2 0x32595559
#define XVIMAGE_YUY2 \
{ \
FOURCC_YUY2, \
XvYUV, \
LSBFirst, \
{'Y','U','Y','2', \
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
16, \
XvPacked, \
1, \
0, 0, 0, 0, \
8, 8, 8, \
1, 2, 2, \
1, 1, 1, \
{'Y','U','Y','V', \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
XvTopToBottom \
}
#define FOURCC_YV12 0x32315659
#define XVIMAGE_YV12 \
{ \
FOURCC_YV12, \
XvYUV, \
LSBFirst, \
{'Y','V','1','2', \
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
12, \
XvPlanar, \
3, \
0, 0, 0, 0, \
8, 8, 8, \
1, 2, 2, \
1, 2, 2, \
{'Y','V','U', \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
XvTopToBottom \
}
#define FOURCC_I420 0x30323449
#define XVIMAGE_I420 \
{ \
FOURCC_I420, \
XvYUV, \
LSBFirst, \
{'I','4','2','0', \
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
12, \
XvPlanar, \
3, \
0, 0, 0, 0, \
8, 8, 8, \
1, 2, 2, \
1, 2, 2, \
{'Y','U','V', \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
XvTopToBottom \
}
#define FOURCC_UYVY 0x59565955
#define XVIMAGE_UYVY \
{ \
FOURCC_UYVY, \
XvYUV, \
LSBFirst, \
{'U','Y','V','Y', \
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
16, \
XvPacked, \
1, \
0, 0, 0, 0, \
8, 8, 8, \
1, 2, 2, \
1, 1, 1, \
{'U','Y','V','Y', \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
XvTopToBottom \
}
#define FOURCC_IA44 0x34344149
#define XVIMAGE_IA44 \
{ \
FOURCC_IA44, \
XvYUV, \
LSBFirst, \
{'I','A','4','4', \
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
8, \
XvPacked, \
1, \
0, 0, 0, 0, \
8, 8, 8, \
1, 1, 1, \
1, 1, 1, \
{'A','I', \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
XvTopToBottom \
}
#define FOURCC_AI44 0x34344941
#define XVIMAGE_AI44 \
{ \
FOURCC_AI44, \
XvYUV, \
LSBFirst, \
{'A','I','4','4', \
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
8, \
XvPacked, \
1, \
0, 0, 0, 0, \
8, 8, 8, \
1, 1, 1, \
1, 1, 1, \
{'I','A', \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
XvTopToBottom \
}
#endif /* _XF86_FOURCC_H_ */
......@@ -55,7 +55,7 @@ AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
-I$(srcdir)/../modes -I$(srcdir)/../ramdac -I$(srcdir)/../dri2 \
-I$(top_builddir)
sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
sdk_HEADERS = compiler.h xf86.h xf86Module.h xf86Opt.h \
xf86PciInfo.h xf86Priv.h xf86Privstr.h \
xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \
$(XVSDKINCS) $(XF86VMODE_SDK) $(DGA_SDK) xorgVersion.h \
......@@ -67,7 +67,6 @@ CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = \
compiler.h \
fourcc.h \
xf86.h \
xf86Bus.h \
xf86Config.h \
......
......@@ -26,7 +26,6 @@ srcs_xorg_common = [
xorg_sdk_headers = [
'compiler.h',
'fourcc.h',
'xf86.h',
'xf86Module.h',
'xf86Opt.h',
......
......@@ -80,6 +80,14 @@ static Bool ms_pci_probe(DriverPtr driver,
intptr_t match_data);
static Bool ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data);
/* window wrapper functions used to get the notification when
* the window property changes */
static Atom vrr_atom;
static Bool property_vectors_wrapped;
static Bool restore_property_vector;
static int (*saved_change_property) (ClientPtr client);
static int (*saved_delete_property) (ClientPtr client);
#ifdef XSERVER_LIBPCIACCESS
static const struct pci_id_match ms_device_match[] = {
{
......@@ -131,6 +139,7 @@ static const OptionInfoRec Options[] = {
{OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE},
{OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_ATOMIC, "Atomic", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_VARIABLE_REFRESH, "VariableRefresh", OPTV_BOOLEAN, {0}, FALSE},
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
......@@ -706,6 +715,132 @@ msBlockHandler_oneshot(ScreenPtr pScreen, void *pTimeout)
drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE);
}
Bool
ms_window_has_variable_refresh(modesettingPtr ms, WindowPtr win) {
struct ms_vrr_priv *priv = dixLookupPrivate(&win->devPrivates, &ms->drmmode.vrrPrivateKeyRec);
return priv->variable_refresh;
}
static void
ms_vrr_property_update(WindowPtr window, Bool variable_refresh)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(window->drawable.pScreen);
modesettingPtr ms = modesettingPTR(scrn);
struct ms_vrr_priv *priv = dixLookupPrivate(&window->devPrivates,
&ms->drmmode.vrrPrivateKeyRec);
priv->variable_refresh = variable_refresh;
if (ms->flip_window == window && ms->drmmode.present_flipping)
ms_present_set_screen_vrr(scrn, variable_refresh);
}
/* Wrapper for xserver/dix/property.c:ProcChangeProperty */
static int
ms_change_property(ClientPtr client)
{
WindowPtr window = NULL;
int ret = 0;
REQUEST(xChangePropertyReq);
client->requestVector[X_ChangeProperty] = saved_change_property;
ret = saved_change_property(client);
if (ret != Success)
return ret;
if (restore_property_vector)
return ret;
client->requestVector[X_ChangeProperty] = ms_change_property;
ret = dixLookupWindow(&window, stuff->window, client, DixSetPropAccess);
if (ret != Success)
return ret;
// Checking for the VRR property change on the window
if (stuff->property == vrr_atom &&
xf86ScreenToScrn(window->drawable.pScreen)->PreInit == PreInit &&
stuff->format == 32 && stuff->nUnits == 1) {
uint32_t *value = (uint32_t *)(stuff + 1);
ms_vrr_property_update(window, *value != 0);
}
return ret;
}
/* Wrapper for xserver/dix/property.c:ProcDeleteProperty */
static int
ms_delete_property(ClientPtr client)
{
WindowPtr window;
int ret;
REQUEST(xDeletePropertyReq);
client->requestVector[X_DeleteProperty] = saved_delete_property;
ret = saved_delete_property(client);
if (restore_property_vector)
return ret;
client->requestVector[X_DeleteProperty] = ms_delete_property;
if (ret != Success)
return ret;
ret = dixLookupWindow(&window, stuff->window, client, DixSetPropAccess);
if (ret != Success)
return ret;
if (stuff->property == vrr_atom &&
xf86ScreenToScrn(window->drawable.pScreen)->PreInit == PreInit)
ms_vrr_property_update(window, FALSE);
return ret;
}
static void
ms_unwrap_property_requests(ScrnInfoPtr scrn)
{
int i;
if (!property_vectors_wrapped)
return;
if (ProcVector[X_ChangeProperty] == ms_change_property)
ProcVector[X_ChangeProperty] = saved_change_property;
else
restore_property_vector = TRUE;
if (ProcVector[X_DeleteProperty] == ms_delete_property)
ProcVector[X_DeleteProperty] = saved_delete_property;
else
restore_property_vector = TRUE;
for (i = 0; i < currentMaxClients; i++) {
if (clients[i]->requestVector[X_ChangeProperty] == ms_change_property) {
clients[i]->requestVector[X_ChangeProperty] = saved_change_property;
} else {
restore_property_vector = TRUE;
}
if (clients[i]->requestVector[X_DeleteProperty] == ms_delete_property) {
clients[i]->requestVector[X_DeleteProperty] = saved_delete_property;
} else {
restore_property_vector = TRUE;
}
}
if (restore_property_vector) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"Couldn't unwrap some window property request vectors\n");
}
property_vectors_wrapped = FALSE;
}
static void
FreeRec(ScrnInfoPtr pScrn)
{
......@@ -725,6 +860,7 @@ FreeRec(ScrnInfoPtr pScrn)
ms_ent = ms_ent_priv(pScrn);
ms_ent->fd_ref--;
if (!ms_ent->fd_ref) {
ms_unwrap_property_requests(pScrn);
if (ms->pEnt->location.type == BUS_PCI)
ret = drmClose(ms->fd);
else
......@@ -1053,6 +1189,13 @@ PreInit(ScrnInfoPtr pScrn, int flags)
ms->drmmode.shadow_enable ? "YES" : "NO");
ms->drmmode.shadow_enable2 = msShouldDoubleShadow(pScrn, ms);
} else {
if (!pScrn->is_gpu) {
MessageType from = xf86GetOptValBool(ms->drmmode.Options, OPTION_VARIABLE_REFRESH,
&ms->vrr_support) ? X_CONFIG : X_DEFAULT;
xf86DrvMsg(pScrn->scrnIndex, from, "VariableRefresh: %sabled\n",
ms->vrr_support ? "en" : "dis");
}
}
ms->drmmode.pageflip =
......@@ -1451,6 +1594,12 @@ CreateScreenResources(ScreenPtr pScreen)
pScrPriv->rrStartFlippingPixmapTracking = msStartFlippingPixmapTracking;
}
if (ms->vrr_support &&
!dixRegisterPrivateKey(&ms->drmmode.vrrPrivateKeyRec,
PRIVATE_WINDOW,
sizeof(struct ms_vrr_priv)))
return FALSE;
return ret;
}
......@@ -1805,6 +1954,18 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
pScrn->vtSema = TRUE;
if (ms->vrr_support) {
if (!property_vectors_wrapped) {
saved_change_property = ProcVector[X_ChangeProperty];
ProcVector[X_ChangeProperty] = ms_change_property;
saved_delete_property = ProcVector[X_DeleteProperty];
ProcVector[X_DeleteProperty] = ms_delete_property;
property_vectors_wrapped = TRUE;
}
vrr_atom = MakeAtom("_VARIABLE_REFRESH",
strlen("_VARIABLE_REFRESH"), TRUE);
}
return TRUE;
}
......
......@@ -43,6 +43,10 @@
#include "drmmode_display.h"
#define MS_LOGLEVEL_DEBUG 4
struct ms_vrr_priv {
Bool variable_refresh;
};
typedef enum {
OPTION_SW_CURSOR,
OPTION_DEVICE_PATH,
......@@ -52,6 +56,7 @@ typedef enum {
OPTION_ZAPHOD_HEADS,
OPTION_DOUBLE_SHADOW,
OPTION_ATOMIC,
OPTION_VARIABLE_REFRESH,
} modesettingOpts;
typedef struct
......@@ -122,6 +127,13 @@ typedef struct _modesettingRec {
Bool kms_has_modifiers;
/* VRR support */
Bool vrr_support;
WindowPtr flip_window;
Bool is_connector_vrr_capable;
uint32_t connector_prop_id;
/* shadow API */
struct {
Bool (*Setup)(ScreenPtr);
......@@ -224,3 +236,5 @@ Bool ms_do_pageflip(ScreenPtr screen,
#endif
int ms_flush_drm_events(ScreenPtr screen);
Bool ms_window_has_variable_refresh(modesettingPtr ms, WindowPtr win);
void ms_present_set_screen_vrr(ScrnInfoPtr scrn, Bool vrr_enabled);
......@@ -2208,6 +2208,53 @@ drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num)
drmModeFreePlaneResources(kplane_res);
}
static uint32_t
drmmode_crtc_get_prop_id(uint32_t drm_fd,
drmModeObjectPropertiesPtr props,
char const* name)
{
uint32_t i, prop_id = 0;
for (i = 0; !prop_id && i < props->count_props; ++i) {
drmModePropertyPtr drm_prop =
drmModeGetProperty(drm_fd, props->props[i]);
if (!drm_prop)
continue;
if (strcmp(drm_prop->name, name) == 0)
prop_id = drm_prop->prop_id;
drmModeFreeProperty(drm_prop);
}
return prop_id;
}
static void
drmmode_crtc_vrr_init(int drm_fd, xf86CrtcPtr crtc)
{
drmModeObjectPropertiesPtr drm_props;
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
if (drmmode->vrr_prop_id)
return;
drm_props = drmModeObjectGetProperties(drm_fd,
drmmode_crtc->mode_crtc->crtc_id,
DRM_MODE_OBJECT_CRTC);
if (!drm_props)
return;
drmmode->vrr_prop_id = drmmode_crtc_get_prop_id(drm_fd,
drm_props,
"VRR_ENABLED");
drmModeFreeObjectProperties(drm_props);
}
static unsigned int
drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res, int num)
{
......@@ -2250,6 +2297,8 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
/* Hide any cursors which may be active from previous users */
drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0);
drmmode_crtc_vrr_init(drmmode->fd, crtc);
/* Mark num'th crtc as in use on this device. */
ms_ent->assigned_crtcs |= (1 << num);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG,
......@@ -2918,6 +2967,40 @@ drmmode_create_name(ScrnInfoPtr pScrn, drmModeConnectorPtr koutput, char *name,
snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id);
}
static Bool
drmmode_connector_check_vrr_capable(uint32_t drm_fd, int connector_id)
{
uint32_t i;
Bool found = FALSE;
uint64_t prop_value = 0;
drmModeObjectPropertiesPtr props;
const char* prop_name = "VRR_CAPABLE";
props = drmModeObjectGetProperties(drm_fd, connector_id,
DRM_MODE_OBJECT_CONNECTOR);
for (i = 0; !found && i < props->count_props; ++i) {
drmModePropertyPtr drm_prop = drmModeGetProperty(drm_fd, props->props[i]);
if (!drm_prop)
continue;
if (strcasecmp(drm_prop->name, prop_name) == 0) {
prop_value = props->prop_values[i];
found = TRUE;
}
drmModeFreeProperty(drm_prop);
}
drmModeFreeObjectProperties(props);
if(found)
return prop_value ? TRUE : FALSE;
return FALSE;
}
static unsigned int
drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res, int num, Bool dynamic, int crtcshift)
{
......@@ -3049,6 +3132,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
}
}
ms->is_connector_vrr_capable =
drmmode_connector_check_vrr_capable(drmmode->fd,
drmmode_output->output_id);
return 1;
out_free_encoders:
......@@ -3968,6 +4054,23 @@ drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int *depth,
return;
}
void
drmmode_crtc_set_vrr(xf86CrtcPtr crtc, Bool enabled)
{
ScrnInfoPtr pScrn = crtc->scrn;
modesettingPtr ms = modesettingPTR(pScrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
if (drmmode->vrr_prop_id && drmmode_crtc->vrr_enabled != enabled &&
drmModeObjectSetProperty(ms->fd,
drmmode_crtc->mode_crtc->crtc_id,
DRM_MODE_OBJECT_CRTC,
drmmode->vrr_prop_id,
enabled) == 0)
drmmode_crtc->vrr_enabled = enabled;
}
/*
* We hook the screen's cursor-sprite (swcursor) functions to see if a swcursor
* is active. When a swcursor is active we disable page-flipping.
......
......@@ -112,6 +112,7 @@ typedef struct {
DevPrivateKeyRec pixmapPrivateKeyRec;
DevScreenPrivateKeyRec spritePrivateKeyRec;
DevPrivateKeyRec vrrPrivateKeyRec;
/* Number of SW cursors currently visible on this screen */
int sprites_visible;
......@@ -127,6 +128,8 @@ typedef struct {
Bool dri2_enable;
Bool present_enable;
uint32_t vrr_prop_id;
} drmmode_rec, *drmmode_ptr;
typedef struct {
......@@ -193,6 +196,8 @@ typedef struct {
Bool enable_flipping;
Bool flipping_active;
Bool vrr_enabled;
} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;
typedef struct {
......@@ -293,5 +298,6 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
int drmmode_crtc_flip(xf86CrtcPtr crtc, uint32_t fb_id, uint32_t flags, void *data);
void drmmode_set_dpms(ScrnInfoPtr scrn, int PowerManagementMode, int flags);
void drmmode_crtc_set_vrr(xf86CrtcPtr crtc, Bool enabled);
#endif
......@@ -70,6 +70,22 @@ ms_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc)
return ms_get_crtc_ust_msc(xf86_crtc, ust, msc);
}
/*
* Changes the variable refresh state for every CRTC on the screen.
*/
void
ms_present_set_screen_vrr(ScrnInfoPtr scrn, Bool vrr_enabled)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CrtcPtr crtc;
int i;
for (i = 0; i < config->num_crtc; i++) {
crtc = config->crtc[i];
drmmode_crtc_set_vrr(crtc, vrr_enabled);
}
}
/*
* Called when the queued vblank event has occurred
*/
......@@ -299,7 +315,12 @@ ms_present_check_flip(RRCrtcPtr crtc,
if (ms->drmmode.sprites_visible > 0)
return FALSE;
return ms_present_check_unflip(crtc, window, pixmap, sync_flip, reason);
if(!ms_present_check_unflip(crtc, window, pixmap, sync_flip, reason))
return FALSE;
ms->flip_window = window;
return TRUE;
}
/*
......@@ -321,7 +342,7 @@ ms_present_flip(RRCrtcPtr crtc,
Bool ret;
struct ms_present_vblank_event *event;
if (!ms_present_check_flip(crtc, screen->root, pixmap, sync_flip, NULL))
if (!ms_present_check_flip(crtc, ms->flip_window, pixmap, sync_flip, NULL))
return FALSE;
event = calloc(1, sizeof(struct ms_present_vblank_event));
......@@ -334,6 +355,17 @@ ms_present_flip(RRCrtcPtr crtc,
event->event_id = event_id;
event->unflip = FALSE;
/* A window can only flip if it covers the entire X screen.
* Only one window can flip at a time.
*
* If the window also has the variable refresh property then
* variable refresh supported can be enabled on every CRTC.
*/
if (ms->vrr_support && ms->is_connector_vrr_capable &&
ms_window_has_variable_refresh(ms, ms->flip_window)) {
ms_present_set_screen_vrr(scrn, TRUE);
}
ret = ms_do_pageflip(screen, pixmap, event, drmmode_crtc->vblank_pipe, !sync_flip,
ms_present_flip_handler, ms_present_flip_abort,
"Present-flip");
......@@ -356,6 +388,8 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id)
int i;
struct ms_present_vblank_event *event;
ms_present_set_screen_vrr(scrn, FALSE);
event = calloc(1, sizeof(struct ms_present_vblank_event));
if (!event)
return;
......
......@@ -123,7 +123,6 @@ cat > sdksyms.c << EOF
/* hw/xfree86/common/Makefile.am */
#include "compiler.h"
#include "fourcc.h"
#include "xf86.h"
#include "xf86Module.h"
#include "xf86Opt.h"
......@@ -251,6 +250,7 @@ cat > sdksyms.c << EOF
#include "exevents.h"
#include "extension.h"
#include "extnsionst.h"
#include "fourcc.h"
#include "gc.h"
#include "gcstruct.h"
#include "globals.h"
......
......@@ -117,21 +117,6 @@ wl_drm_format_for_depth(int depth)
}
}
static char
is_fd_render_node(int fd)
{
struct stat render;
if (fstat(fd, &render))
return 0;
if (!S_ISCHR(render.st_mode))
return 0;
if (render.st_rdev & 0x80)
return 1;
return 0;
}
static char
is_device_path_render_node (const char *device_path)
{
......@@ -142,7 +127,7 @@ is_device_path_render_node (const char *device_path)
if (fd < 0)
return 0;
is_render_node = is_fd_render_node(fd);
is_render_node = (drmGetNodeTypeFromFd(fd) == DRM_NODE_RENDER);
close(fd);
return is_render_node;
......@@ -782,7 +767,7 @@ xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device)
return;
}
if (is_fd_render_node(xwl_gbm->drm_fd)) {
if (drmGetNodeTypeFromFd(xwl_gbm->drm_fd) == DRM_NODE_RENDER) {
xwl_gbm->fd_render_node = 1;
xwl_screen->expecting_event--;
} else {
......
......@@ -23,6 +23,7 @@ sdk_HEADERS = \
extension.h \
extinit.h \
extnsionst.h \
fourcc.h \
gc.h \
gcstruct.h \
globals.h \
......
......@@ -445,6 +445,7 @@ if build_xorg
'extension.h',
'extinit.h',
'extnsionst.h',
'fourcc.h',
'gc.h',
'gcstruct.h',
'globals.h',
......
noinst_LTLIBRARIES = libpresent.la
AM_CFLAGS = \
-DHAVE_XORG_CONFIG_H \
@DIX_CFLAGS@ @XORG_CFLAGS@
@DIX_CFLAGS@
libpresent_la_SOURCES = \
present.h \
......
......@@ -24,7 +24,6 @@ libxserver_present = static_library('libxserver_present',
common_dep,
dependency('presentproto', version: '>= 1.2')
],
c_args: '-DHAVE_XORG_CONFIG_H'
)
install_data(hdrs_present, install_dir: xorgsdkdir)
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
#include <gcstruct.h>
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
static RESTYPE present_event_type;
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
/*
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
#include "list.h"
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
#include <gcstruct.h>
#include <misync.h>
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
/*
......
......@@ -23,6 +23,7 @@
#ifndef _PRESENT_PRIV_H_
#define _PRESENT_PRIV_H_
#include "dix-config.h"
#include <X11/X.h>
#include "scrnintstr.h"
#include "misc.h"
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
#include "randrstr.h"
#include <protocol-versions.h>
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
#include <misync.h>
#include <misyncstr.h>
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
int present_request;
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
void
......
......@@ -20,10 +20,6 @@
* OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "present_priv.h"
/*
......