Skip to content

Commit

Permalink
wlserver: Forward HDR metadata in nested
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Oct 18, 2023
1 parent 62e2d45 commit 2f8edeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 7 additions & 4 deletions src/drm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3107,11 +3107,14 @@ std::pair<uint32_t, uint32_t> drm_get_connector_identifier(struct drm_t *drm)
std::shared_ptr<wlserver_hdr_metadata> drm_create_hdr_metadata_blob(struct drm_t *drm, hdr_output_metadata *metadata)
{
uint32_t blob = 0;
int ret = drmModeCreatePropertyBlob(drm->fd, metadata, sizeof(*metadata), &blob);
if (BIsNested())
{
int ret = drmModeCreatePropertyBlob(drm->fd, metadata, sizeof(*metadata), &blob);

if (ret != 0) {
drm_log.errorf("Failed to create blob for HDR_OUTPUT_METADATA. (%s) Falling back to null blob.", strerror(-ret));
blob = 0;
if (ret != 0) {
drm_log.errorf("Failed to create blob for HDR_OUTPUT_METADATA. (%s) Falling back to null blob.", strerror(-ret));
blob = 0;
}
}

if (!blob)
Expand Down
5 changes: 0 additions & 5 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,6 @@ static void gamescope_swapchain_set_hdr_metadata( struct wl_client *client, stru
uint32_t max_fall)
{
wlserver_wl_surface_info *wl_info = (wlserver_wl_surface_info *)wl_resource_get_user_data( resource );
if ( BIsNested() )
{
wl_log.infof("Ignoring HDR metadata when nested.");
return;
}

if ( wl_info )
{
Expand Down

0 comments on commit 2f8edeb

Please sign in to comment.