Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting drm content type property #140

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading