drivers/gpu/drm/drm_colorop.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/drm_colorop.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/drm_colorop.c- Extension
.c- Size
- 19137 bytes
- Lines
- 647
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_colorop.hdrm/drm_print.hdrm/drm_drv.hdrm/drm_plane.hdrm_crtc_internal.h
Detected Declarations
function drm_plane_colorop_initfunction drm_colorop_cleanupfunction drm_colorop_destroyfunction drm_colorop_pipeline_destroyfunction list_for_each_entry_safefunction BITfunction drm_colorop_create_data_propfunction drm_plane_colorop_curve_1d_lut_initfunction drm_plane_colorop_ctm_3x4_initfunction drm_plane_colorop_mult_initfunction drm_plane_colorop_3dlut_initfunction __drm_atomic_helper_colorop_duplicate_statefunction drm_atomic_helper_colorop_duplicate_statefunction __drm_atomic_helper_colorop_destroy_statefunction drm_colorop_atomic_destroy_statefunction __drm_colorop_state_resetfunction __drm_colorop_resetfunction drm_colorop_resetfunction drm_colorop_set_next_propertyexport drm_colorop_cleanupexport drm_colorop_destroyexport drm_colorop_pipeline_destroyexport drm_plane_colorop_curve_1d_initexport drm_plane_colorop_curve_1d_lut_initexport drm_plane_colorop_ctm_3x4_initexport drm_plane_colorop_mult_initexport drm_plane_colorop_3dlut_initexport drm_colorop_set_next_property
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#include <drm/drm_colorop.h>
#include <drm/drm_print.h>
#include <drm/drm_drv.h>
#include <drm/drm_plane.h>
#include "drm_crtc_internal.h"
/**
* DOC: overview
*
* When userspace signals the &DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE it
* should use the COLOR_PIPELINE plane property and associated colorops
* for any color operation on the &drm_plane. Setting of all old color
* properties, such as COLOR_ENCODING and COLOR_RANGE, will be rejected
* and the values of the properties will be ignored.
*
* Colorops are only advertised and valid for atomic drivers and atomic
* userspace that signals the &DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE
* client cap.
*
* A colorop represents a single color operation. Colorops are chained
* via the NEXT property and make up color pipelines. Color pipelines
* are advertised and selected via the COLOR_PIPELINE &drm_plane
* property.
*
* A colorop will be of a certain type, advertised by the read-only TYPE
* property. Each type of colorop will advertise a different set of
* properties and is programmed in a different manner. Types can be
* enumerated 1D curves, 1D LUTs, 3D LUTs, matrices, etc. See the
* &drm_colorop_type documentation for information on each type.
*
* If a colorop advertises the BYPASS property it can be bypassed.
*
* Information about colorop and color pipeline design decisions can be
* found at rfc/color_pipeline.rst, but note that this document will
* grow stale over time.
*/
static const struct drm_prop_enum_list drm_colorop_type_enum_list[] = {
{ DRM_COLOROP_1D_CURVE, "1D Curve" },
{ DRM_COLOROP_1D_LUT, "1D LUT" },
{ DRM_COLOROP_CTM_3X4, "3x4 Matrix"},
{ DRM_COLOROP_MULTIPLIER, "Multiplier"},
{ DRM_COLOROP_3D_LUT, "3D LUT"},
};
static const char * const colorop_curve_1d_type_names[] = {
[DRM_COLOROP_1D_CURVE_SRGB_EOTF] = "sRGB EOTF",
[DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF] = "sRGB Inverse EOTF",
[DRM_COLOROP_1D_CURVE_PQ_125_EOTF] = "PQ 125 EOTF",
[DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF] = "PQ 125 Inverse EOTF",
[DRM_COLOROP_1D_CURVE_BT2020_INV_OETF] = "BT.2020 Inverse OETF",
[DRM_COLOROP_1D_CURVE_BT2020_OETF] = "BT.2020 OETF",
[DRM_COLOROP_1D_CURVE_GAMMA22] = "Gamma 2.2",
[DRM_COLOROP_1D_CURVE_GAMMA22_INV] = "Gamma 2.2 Inverse",
};
static const struct drm_prop_enum_list drm_colorop_lut1d_interpolation_list[] = {
{ DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR, "Linear" },
};
static const struct drm_prop_enum_list drm_colorop_lut3d_interpolation_list[] = {
{ DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL, "Tetrahedral" },
Annotation
- Immediate include surface: `drm/drm_colorop.h`, `drm/drm_print.h`, `drm/drm_drv.h`, `drm/drm_plane.h`, `drm_crtc_internal.h`.
- Detected declarations: `function drm_plane_colorop_init`, `function drm_colorop_cleanup`, `function drm_colorop_destroy`, `function drm_colorop_pipeline_destroy`, `function list_for_each_entry_safe`, `function BIT`, `function drm_colorop_create_data_prop`, `function drm_plane_colorop_curve_1d_lut_init`, `function drm_plane_colorop_ctm_3x4_init`, `function drm_plane_colorop_mult_init`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.