Skip to content

Commit

Permalink
drm/output: add api to set drm content type property (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
UjinT34 authored Feb 2, 2025
1 parent 95506e5 commit 257b205
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/aquamarine/output/Output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace Aquamarine {
Hyprutils::Math::Mat3x3 ctm;
bool wideColorGamut = false;
hdr_output_metadata hdrMetadata;
uint16_t contentType = DRM_MODE_CONTENT_TYPE_GRAPHICS;
};

const SInternalState& state();
Expand All @@ -99,6 +100,7 @@ namespace Aquamarine {
void setCTM(const Hyprutils::Math::Mat3x3& ctm);
void setWideColorGamut(bool wcg);
void setHDRMetadata(const hdr_output_metadata& metadata);
void setContentType(const uint16_t drmContentType);

private:
SInternalState internalState;
Expand Down
3 changes: 1 addition & 2 deletions src/backend/drm/impl/Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ void Aquamarine::CDRMAtomicRequest::addConnector(Hyprutils::Memory::CSharedPoint

add(connector->id, connector->props.crtc_id, enable ? connector->crtc->id : 0);

// TODO: allow to send aq a content type, maybe? Wayland has a protocol for this.
if (enable && connector->props.content_type)
add(connector->id, connector->props.content_type, DRM_MODE_CONTENT_TYPE_GRAPHICS);
add(connector->id, connector->props.content_type, STATE.contentType);

add(connector->crtc->id, connector->crtc->props.active, enable);

Expand Down
4 changes: 4 additions & 0 deletions src/output/Output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ void Aquamarine::COutputState::setHDRMetadata(const hdr_output_metadata& metadat
internalState.committed |= AQ_OUTPUT_STATE_HDR;
}

void Aquamarine::COutputState::setContentType(const uint16_t drmContentType) {
internalState.contentType = drmContentType;
}

void Aquamarine::COutputState::onCommit() {
internalState.committed = 0;
internalState.damage.clear();
Expand Down

0 comments on commit 257b205

Please sign in to comment.