Skip to main content

CrtcColorPipeline

Struct CrtcColorPipeline 

Source
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>

Source

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
Source

pub const fn capabilities(&self) -> &CrtcCapabilities

What this CRTC can do.

Source

pub fn blob_id(&self, stage: Stage) -> Option<u64>

The blob currently staged for a stage, if any.

Source

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.

Source

pub fn set_pq_to_linear(&mut self) -> Result<(), PipelineError>

Degamma: PQ encoded to linear, for HDR10 content.

§Errors
Source

pub fn set_hlg_to_linear(&mut self) -> Result<(), PipelineError>

Degamma: HLG encoded to scene-linear.

§Errors

As CrtcColorPipeline::set_pq_to_linear.

Source

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
Source

pub fn set_linear_to_pq(&mut self) -> Result<(), PipelineError>

Gamma: linear to PQ encoded, for HDR10 output.

§Errors
Source

pub fn set_custom_lut( &mut self, stage: Stage, lut: &[ColorLut], ) -> Result<(), PipelineError>

Stage a LUT of the caller’s own.

§Errors
Source

pub fn set_custom_ctm(&mut self, ctm: ColorCtm) -> Result<(), PipelineError>

Stage a matrix of the caller’s own.

§Errors

As CrtcColorPipeline::set_bt2020_to_bt709.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> Debug for CrtcColorPipeline<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CrtcColorPipeline<'a>

§

impl<'a> RefUnwindSafe for CrtcColorPipeline<'a>

§

impl<'a> Send for CrtcColorPipeline<'a>

§

impl<'a> Sync for CrtcColorPipeline<'a>

§

impl<'a> Unpin for CrtcColorPipeline<'a>

§

impl<'a> UnsafeUnpin for CrtcColorPipeline<'a>

§

impl<'a> UnwindSafe for CrtcColorPipeline<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.