pub struct CrtcColorPipeline<'a> { /* private fields */ }Expand description
The color pipeline of one CRTC.
Holds the blobs it creates and destroys them on drop, and borrows the device so a blob cannot outlive the descriptor that has to free it.
Implementations§
Source§impl<'a> CrtcColorPipeline<'a>
impl<'a> CrtcColorPipeline<'a>
Sourcepub fn new(device: &'a Device, crtc_id: u32) -> Result<Self, PipelineError>
pub fn new(device: &'a Device, crtc_id: u32) -> Result<Self, PipelineError>
Read a CRTC’s color capabilities and prepare to program them.
A driver exposing only part of the pipeline – vkms has gamma and nothing else – succeeds; the stages it lacks refuse.
§Errors
PipelineError::NoPipelineif the CRTC has none of the three.PipelineError::Coreif its properties cannot be read.
Sourcepub const fn capabilities(&self) -> &CrtcCapabilities
pub const fn capabilities(&self) -> &CrtcCapabilities
What this CRTC can do.
Sourcepub fn blob_id(&self, stage: Stage) -> Option<u64>
pub fn blob_id(&self, stage: Stage) -> Option<u64>
The blob currently staged for a stage, if any.
Sourcepub fn set_identity(&mut self) -> Result<(), PipelineError>
pub fn set_identity(&mut self) -> Result<(), PipelineError>
Set every stage this CRTC has to identity.
For taking over a display from something that left a curve on it: the kernel keeps whatever the last client set, so a compositor that never writes these inherits them.
§Errors
PipelineError::Core if a blob cannot be created.
Sourcepub fn set_pq_to_linear(&mut self) -> Result<(), PipelineError>
pub fn set_pq_to_linear(&mut self) -> Result<(), PipelineError>
Degamma: PQ encoded to linear, for HDR10 content.
§Errors
PipelineError::NoSuchStageif the CRTC has no degamma stage.PipelineError::Coreif the blob cannot be created.
Sourcepub fn set_hlg_to_linear(&mut self) -> Result<(), PipelineError>
pub fn set_hlg_to_linear(&mut self) -> Result<(), PipelineError>
Sourcepub fn set_bt2020_to_bt709(&mut self) -> Result<(), PipelineError>
pub fn set_bt2020_to_bt709(&mut self) -> Result<(), PipelineError>
Matrix: BT.2020 to BT.709, in linear light.
Needs a degamma stage in front of it that produces linear values.
§Errors
PipelineError::NoSuchStageif the CRTC has no matrix stage.PipelineError::Coreif the blob cannot be created.
Sourcepub fn set_linear_to_pq(&mut self) -> Result<(), PipelineError>
pub fn set_linear_to_pq(&mut self) -> Result<(), PipelineError>
Gamma: linear to PQ encoded, for HDR10 output.
§Errors
PipelineError::NoSuchStageif the CRTC has no gamma stage.PipelineError::Coreif the blob cannot be created.
Sourcepub fn set_custom_lut(
&mut self,
stage: Stage,
lut: &[ColorLut],
) -> Result<(), PipelineError>
pub fn set_custom_lut( &mut self, stage: Stage, lut: &[ColorLut], ) -> Result<(), PipelineError>
Stage a LUT of the caller’s own.
§Errors
PipelineError::NoSuchStageif the CRTC has no such stage,PipelineError::NotALutfor the matrix, orPipelineError::WrongLutSizeiflutis not the length the driver asks for.PipelineError::Coreif the blob cannot be created.
Sourcepub fn set_custom_ctm(&mut self, ctm: ColorCtm) -> Result<(), PipelineError>
pub fn set_custom_ctm(&mut self, ctm: ColorCtm) -> Result<(), PipelineError>
Sourcepub fn apply(&self, request: &mut AtomicRequest) -> Result<(), PipelineError>
pub fn apply(&self, request: &mut AtomicRequest) -> Result<(), PipelineError>
Write the staged blob ids into request.
A stage that has not been set is left out. The kernel keeps whatever
the property already holds, which is what a caller programming only
gamma wants – and is also why set_identity
exists for a caller that does not.
§Errors
PipelineError::Core if a property cannot be added to the request.
Sourcepub fn forget_for_session_loss(&mut self)
pub fn forget_for_session_loss(&mut self)
Forget every blob without destroying it.
For a session pause, which revokes the descriptor the blobs were made on – the kernel reclaimed them at that moment, and destroying through the replacement descriptor would at best fail and at worst free a different blob that happens to have the same id there.