steamcompmgr: Add GAMESCOPE_COLOR_APP_WANTS_HDR_FEEDBACK
Tell Steam whether this app is wanting HDR or not. (Whether it's submitting HDR buffers)
This commit is contained in:
parent
77095cb553
commit
b529bba53a
3 changed files with 28 additions and 0 deletions
|
@ -42,6 +42,12 @@ enum GamescopeAppTextureColorspace {
|
||||||
};
|
};
|
||||||
const uint32_t GamescopeAppTextureColorspace_Bits = 2;
|
const uint32_t GamescopeAppTextureColorspace_Bits = 2;
|
||||||
|
|
||||||
|
inline bool ColorspaceIsHDR( GamescopeAppTextureColorspace colorspace )
|
||||||
|
{
|
||||||
|
return colorspace == GAMESCOPE_APP_TEXTURE_COLORSPACE_SCRGB ||
|
||||||
|
colorspace == GAMESCOPE_APP_TEXTURE_COLORSPACE_HDR10_PQ;
|
||||||
|
}
|
||||||
|
|
||||||
extern struct drm_t g_DRM;
|
extern struct drm_t g_DRM;
|
||||||
void drm_destroy_hdr_metadata_blob(struct drm_t *drm, uint32_t blob);
|
void drm_destroy_hdr_metadata_blob(struct drm_t *drm, uint32_t blob);
|
||||||
|
|
||||||
|
|
|
@ -6100,6 +6100,7 @@ void init_xwayland_ctx(uint32_t serverId, gamescope_xwayland_server_t *xwayland_
|
||||||
ctx->atoms.gamescopeColorSDRGamutWideness = XInternAtom( ctx->dpy, "GAMESCOPE_COLOR_SDR_GAMUT_WIDENESS", false );
|
ctx->atoms.gamescopeColorSDRGamutWideness = XInternAtom( ctx->dpy, "GAMESCOPE_COLOR_SDR_GAMUT_WIDENESS", false );
|
||||||
ctx->atoms.gamescopeColorNightMode = XInternAtom( ctx->dpy, "GAMESCOPE_COLOR_NIGHT_MODE", false );
|
ctx->atoms.gamescopeColorNightMode = XInternAtom( ctx->dpy, "GAMESCOPE_COLOR_NIGHT_MODE", false );
|
||||||
ctx->atoms.gamescopeColorManagementDisable = XInternAtom( ctx->dpy, "GAMESCOPE_COLOR_MANAGEMENT_DISABLE", false );
|
ctx->atoms.gamescopeColorManagementDisable = XInternAtom( ctx->dpy, "GAMESCOPE_COLOR_MANAGEMENT_DISABLE", false );
|
||||||
|
ctx->atoms.gamescopeColorAppWantsHDRFeedback = XInternAtom( ctx->dpy, "GAMESCOPE_COLOR_APP_WANTS_HDR_FEEDBACK", false );
|
||||||
|
|
||||||
ctx->atoms.gamescopeCreateXWaylandServer = XInternAtom( ctx->dpy, "GAMESCOPE_CREATE_XWAYLAND_SERVER", false );
|
ctx->atoms.gamescopeCreateXWaylandServer = XInternAtom( ctx->dpy, "GAMESCOPE_CREATE_XWAYLAND_SERVER", false );
|
||||||
ctx->atoms.gamescopeCreateXWaylandServerFeedback = XInternAtom( ctx->dpy, "GAMESCOPE_CREATE_XWAYLAND_SERVER_FEEDBACK", false );
|
ctx->atoms.gamescopeCreateXWaylandServerFeedback = XInternAtom( ctx->dpy, "GAMESCOPE_CREATE_XWAYLAND_SERVER_FEEDBACK", false );
|
||||||
|
@ -6606,6 +6607,26 @@ steamcompmgr_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
GamescopeAppTextureColorspace current_app_colorspace = GAMESCOPE_APP_TEXTURE_COLORSPACE_SRGB;
|
||||||
|
if ( g_HeldCommits[HELD_COMMIT_BASE] )
|
||||||
|
current_app_colorspace = g_HeldCommits[HELD_COMMIT_BASE]->colorspace();
|
||||||
|
|
||||||
|
bool app_wants_hdr = ColorspaceIsHDR( current_app_colorspace );
|
||||||
|
|
||||||
|
static bool s_bAppWantsHDRCached = false;
|
||||||
|
|
||||||
|
if ( app_wants_hdr != s_bAppWantsHDRCached )
|
||||||
|
{
|
||||||
|
uint32_t app_wants_hdr_prop = app_wants_hdr ? 1 : 0;
|
||||||
|
|
||||||
|
XChangeProperty(root_ctx->dpy, root_ctx->root, root_ctx->atoms.gamescopeColorAppWantsHDRFeedback, XA_CARDINAL, 32, PropModeReplace,
|
||||||
|
(unsigned char *)&app_wants_hdr_prop, 1 );
|
||||||
|
|
||||||
|
s_bAppWantsHDRCached = app_wants_hdr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
currentOutputWidth = g_nOutputWidth;
|
currentOutputWidth = g_nOutputWidth;
|
||||||
currentOutputHeight = g_nOutputHeight;
|
currentOutputHeight = g_nOutputHeight;
|
||||||
currentHDROutput = g_bOutputHDREnabled;
|
currentHDROutput = g_bOutputHDREnabled;
|
||||||
|
|
|
@ -191,6 +191,7 @@ struct xwayland_ctx_t
|
||||||
Atom gamescopeColorSDRGamutWideness;
|
Atom gamescopeColorSDRGamutWideness;
|
||||||
Atom gamescopeColorNightMode; // amount, hue, saturation
|
Atom gamescopeColorNightMode; // amount, hue, saturation
|
||||||
Atom gamescopeColorManagementDisable;
|
Atom gamescopeColorManagementDisable;
|
||||||
|
Atom gamescopeColorAppWantsHDRFeedback;
|
||||||
|
|
||||||
Atom gamescopeCreateXWaylandServer;
|
Atom gamescopeCreateXWaylandServer;
|
||||||
Atom gamescopeCreateXWaylandServerFeedback;
|
Atom gamescopeCreateXWaylandServerFeedback;
|
||||||
|
|
Loading…
Reference in a new issue