drivers/media/platform/qcom/iris/iris_hfi_common.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/iris/iris_hfi_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/iris/iris_hfi_common.c- Extension
.c- Size
- 3861 bytes
- Lines
- 181
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pm_runtime.hiris_firmware.hiris_core.hiris_hfi_common.hiris_vpu_common.h
Detected Declarations
function Copyrightfunction iris_hfi_get_v4l2_transfer_charfunction iris_hfi_get_v4l2_matrix_coefficientsfunction iris_hfi_core_initfunction iris_hfi_isrfunction iris_hfi_isr_handlerfunction iris_hfi_pm_suspendfunction iris_hfi_pm_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/pm_runtime.h>
#include "iris_firmware.h"
#include "iris_core.h"
#include "iris_hfi_common.h"
#include "iris_vpu_common.h"
u32 iris_hfi_get_v4l2_color_primaries(u32 hfi_primaries)
{
switch (hfi_primaries) {
case HFI_PRIMARIES_RESERVED:
return V4L2_COLORSPACE_DEFAULT;
case HFI_PRIMARIES_BT709:
return V4L2_COLORSPACE_REC709;
case HFI_PRIMARIES_BT470_SYSTEM_M:
return V4L2_COLORSPACE_470_SYSTEM_M;
case HFI_PRIMARIES_BT470_SYSTEM_BG:
return V4L2_COLORSPACE_470_SYSTEM_BG;
case HFI_PRIMARIES_BT601_525:
return V4L2_COLORSPACE_SMPTE170M;
case HFI_PRIMARIES_SMPTE_ST240M:
return V4L2_COLORSPACE_SMPTE240M;
case HFI_PRIMARIES_BT2020:
return V4L2_COLORSPACE_BT2020;
case V4L2_COLORSPACE_DCI_P3:
return HFI_PRIMARIES_SMPTE_RP431_2;
default:
return V4L2_COLORSPACE_DEFAULT;
}
}
u32 iris_hfi_get_v4l2_transfer_char(u32 hfi_characterstics)
{
switch (hfi_characterstics) {
case HFI_TRANSFER_RESERVED:
return V4L2_XFER_FUNC_DEFAULT;
case HFI_TRANSFER_BT709:
return V4L2_XFER_FUNC_709;
case HFI_TRANSFER_SMPTE_ST240M:
return V4L2_XFER_FUNC_SMPTE240M;
case HFI_TRANSFER_SRGB_SYCC:
return V4L2_XFER_FUNC_SRGB;
case HFI_TRANSFER_SMPTE_ST2084_PQ:
return V4L2_XFER_FUNC_SMPTE2084;
default:
return V4L2_XFER_FUNC_DEFAULT;
}
}
u32 iris_hfi_get_v4l2_matrix_coefficients(u32 hfi_coefficients)
{
switch (hfi_coefficients) {
case HFI_MATRIX_COEFF_RESERVED:
return V4L2_YCBCR_ENC_DEFAULT;
case HFI_MATRIX_COEFF_BT709:
return V4L2_YCBCR_ENC_709;
case HFI_MATRIX_COEFF_BT470_SYS_BG_OR_BT601_625:
return V4L2_YCBCR_ENC_XV601;
case HFI_MATRIX_COEFF_BT601_525_BT1358_525_OR_625:
return V4L2_YCBCR_ENC_601;
case HFI_MATRIX_COEFF_SMPTE_ST240:
return V4L2_YCBCR_ENC_SMPTE240M;
case HFI_MATRIX_COEFF_BT2020_NON_CONSTANT:
return V4L2_YCBCR_ENC_BT2020;
case HFI_MATRIX_COEFF_BT2020_CONSTANT:
return V4L2_YCBCR_ENC_BT2020_CONST_LUM;
default:
return V4L2_YCBCR_ENC_DEFAULT;
}
}
int iris_hfi_core_init(struct iris_core *core)
{
const struct iris_hfi_sys_ops *hfi_ops = core->hfi_sys_ops;
int ret;
ret = hfi_ops->sys_init(core);
if (ret)
return ret;
ret = hfi_ops->sys_image_version(core);
if (ret)
return ret;
return hfi_ops->sys_interframe_powercollapse(core);
Annotation
- Immediate include surface: `linux/pm_runtime.h`, `iris_firmware.h`, `iris_core.h`, `iris_hfi_common.h`, `iris_vpu_common.h`.
- Detected declarations: `function Copyright`, `function iris_hfi_get_v4l2_transfer_char`, `function iris_hfi_get_v4l2_matrix_coefficients`, `function iris_hfi_core_init`, `function iris_hfi_isr`, `function iris_hfi_isr_handler`, `function iris_hfi_pm_suspend`, `function iris_hfi_pm_resume`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.