Skip to content

Commit

Permalink
Disable DRM_CLIENT_CAP_WRITEBACK_CONNECTORS by default and add SRM_EN…
Browse files Browse the repository at this point in the history
…ABLE_WRITEBACK_CONNECTORS env
  • Loading branch information
ehopperdietzel committed Sep 4, 2024
1 parent 94a6f6e commit b54ef30
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/lib/private/SRMDevicePrivate.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,20 +795,32 @@ UInt8 srmDeviceUpdateGLExtensions(SRMDevice *device)
return 1;
}


UInt8 srmDeviceUpdateClientCaps(SRMDevice *device)
{
device->clientCapStereo3D = drmSetClientCap(device->fd, DRM_CLIENT_CAP_STEREO_3D, 1) == 0;
device->clientCapUniversalPlanes = drmSetClientCap(device->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) == 0;
device->clientCapAtomic = drmSetClientCap(device->fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0;
device->clientCapStereo3D = drmSetClientCap(device->fd, DRM_CLIENT_CAP_STEREO_3D, 1) == 0;

char *forceLegacyENV = getenv("SRM_FORCE_LEGACY_API");

if (!forceLegacyENV || atoi(forceLegacyENV) != 1)
device->clientCapAtomic = drmSetClientCap(device->fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0;

if (device->clientCapAtomic)
{
// Enabled implicitly by atomic
device->clientCapAspectRatio = 1;
device->clientCapUniversalPlanes = 1;

char *atomicENV = getenv("SRM_FORCE_LEGACY_API");
char *writebackENV = getenv("SRM_ENABLE_WRITEBACK_CONNECTORS");

if (atomicENV && atoi(atomicENV) == 1)
device->clientCapAtomic = 0;
if (writebackENV && atoi(writebackENV) == 1)
device->clientCapWritebackConnectors = drmSetClientCap(device->fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1) == 0;
}
else
{
device->clientCapAspectRatio = drmSetClientCap(device->fd, DRM_CLIENT_CAP_ASPECT_RATIO, 1) == 0;
device->clientCapUniversalPlanes = drmSetClientCap(device->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) == 0;
}

device->clientCapAspectRatio = drmSetClientCap(device->fd, DRM_CLIENT_CAP_ASPECT_RATIO, 1) == 0;
device->clientCapWritebackConnectors = drmSetClientCap(device->fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1) == 0;
return 1;
}

Expand Down

0 comments on commit b54ef30

Please sign in to comment.