drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c- Extension
.c- Size
- 8321 bytes
- Lines
- 297
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/printk.hlinux/soc/qcom/ubwc.hiris_hfi_common.hiris_hfi_gen2.hiris_hfi_gen2_packet.h
Detected Declarations
function Copyrightfunction iris_hfi_gen2_get_transfer_charfunction iris_hfi_gen2_get_matrix_coefficientsfunction iris_hfi_gen2_get_color_infofunction iris_hfi_gen2_create_headerfunction iris_hfi_gen2_create_packetfunction iris_hfi_gen2_packet_sys_initfunction iris_hfi_gen2_packet_image_versionfunction iris_hfi_gen2_packet_session_commandfunction iris_hfi_gen2_packet_session_propertyfunction iris_hfi_gen2_packet_sys_interframe_powercollapsefunction iris_hfi_gen2_packet_sys_pc_prep
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/printk.h>
#include <linux/soc/qcom/ubwc.h>
#include "iris_hfi_common.h"
#include "iris_hfi_gen2.h"
#include "iris_hfi_gen2_packet.h"
u32 iris_hfi_gen2_get_color_primaries(u32 primaries)
{
switch (primaries) {
case V4L2_COLORSPACE_DEFAULT:
return HFI_PRIMARIES_RESERVED;
case V4L2_COLORSPACE_REC709:
return HFI_PRIMARIES_BT709;
case V4L2_COLORSPACE_470_SYSTEM_M:
return HFI_PRIMARIES_BT470_SYSTEM_M;
case V4L2_COLORSPACE_470_SYSTEM_BG:
return HFI_PRIMARIES_BT470_SYSTEM_BG;
case V4L2_COLORSPACE_SMPTE170M:
return HFI_PRIMARIES_BT601_525;
case V4L2_COLORSPACE_SMPTE240M:
return HFI_PRIMARIES_SMPTE_ST240M;
case V4L2_COLORSPACE_BT2020:
return HFI_PRIMARIES_BT2020;
case V4L2_COLORSPACE_DCI_P3:
return HFI_PRIMARIES_SMPTE_RP431_2;
default:
return HFI_PRIMARIES_RESERVED;
}
}
u32 iris_hfi_gen2_get_transfer_char(u32 characterstics)
{
switch (characterstics) {
case V4L2_XFER_FUNC_DEFAULT:
return HFI_TRANSFER_RESERVED;
case V4L2_XFER_FUNC_709:
return HFI_TRANSFER_BT709;
case V4L2_XFER_FUNC_SMPTE240M:
return HFI_TRANSFER_SMPTE_ST240M;
case V4L2_XFER_FUNC_SRGB:
return HFI_TRANSFER_SRGB_SYCC;
case V4L2_XFER_FUNC_SMPTE2084:
return HFI_TRANSFER_SMPTE_ST2084_PQ;
default:
return HFI_TRANSFER_RESERVED;
}
}
u32 iris_hfi_gen2_get_matrix_coefficients(u32 coefficients)
{
switch (coefficients) {
case V4L2_YCBCR_ENC_DEFAULT:
return HFI_MATRIX_COEFF_RESERVED;
case V4L2_YCBCR_ENC_709:
return HFI_MATRIX_COEFF_BT709;
case V4L2_YCBCR_ENC_XV709:
return HFI_MATRIX_COEFF_BT709;
case V4L2_YCBCR_ENC_XV601:
return HFI_MATRIX_COEFF_BT470_SYS_BG_OR_BT601_625;
case V4L2_YCBCR_ENC_601:
return HFI_MATRIX_COEFF_BT601_525_BT1358_525_OR_625;
case V4L2_YCBCR_ENC_SMPTE240M:
return HFI_MATRIX_COEFF_SMPTE_ST240;
case V4L2_YCBCR_ENC_BT2020:
return HFI_MATRIX_COEFF_BT2020_NON_CONSTANT;
case V4L2_YCBCR_ENC_BT2020_CONST_LUM:
return HFI_MATRIX_COEFF_BT2020_CONSTANT;
default:
return HFI_MATRIX_COEFF_RESERVED;
}
}
u32 iris_hfi_gen2_get_color_info(u32 matrix_coeff, u32 transfer_char, u32 primaries,
u32 colour_description_present_flag, u32 full_range,
u32 video_format, u32 video_signal_type_present_flag)
{
return (matrix_coeff & 0xFF) |
((transfer_char << 8) & 0xFF00) |
((primaries << 16) & 0xFF0000) |
((colour_description_present_flag << 24) & 0x1000000) |
((full_range << 25) & 0x2000000) |
((video_format << 26) & 0x1C000000) |
((video_signal_type_present_flag << 29) & 0x20000000);
}
Annotation
- Immediate include surface: `linux/printk.h`, `linux/soc/qcom/ubwc.h`, `iris_hfi_common.h`, `iris_hfi_gen2.h`, `iris_hfi_gen2_packet.h`.
- Detected declarations: `function Copyright`, `function iris_hfi_gen2_get_transfer_char`, `function iris_hfi_gen2_get_matrix_coefficients`, `function iris_hfi_gen2_get_color_info`, `function iris_hfi_gen2_create_header`, `function iris_hfi_gen2_create_packet`, `function iris_hfi_gen2_packet_sys_init`, `function iris_hfi_gen2_packet_image_version`, `function iris_hfi_gen2_packet_session_command`, `function iris_hfi_gen2_packet_session_property`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.