Skip to content

Commit

Permalink
drm: fix other headless NPE
Browse files Browse the repository at this point in the history
fixes a980d91
  • Loading branch information
libcg authored and misyltoad committed Dec 21, 2023
1 parent b1879a3 commit b0ce622
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/drm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2519,10 +2519,10 @@ int drm_prepare( struct drm_t *drm, bool async, const struct FrameInfo_t *frameI
assert( drm->req == nullptr );
drm->req = drmModeAtomicAlloc();

bool bConnectorSupportsHDR = drm->connector->metadata.supportsST2084;
bool bConnectorHDR = g_bOutputHDREnabled && bConnectorSupportsHDR;

if (drm->connector != nullptr) {
bool bConnectorSupportsHDR = drm->connector->metadata.supportsST2084;
bool bConnectorHDR = g_bOutputHDREnabled && bConnectorSupportsHDR;

if (drm->connector->has_colorspace) {
drm->connector->pending.colorspace = ( bConnectorHDR ) ? DRM_MODE_COLORIMETRY_BT2020_RGB : DRM_MODE_COLORIMETRY_DEFAULT;
}
Expand Down

0 comments on commit b0ce622

Please sign in to comment.