Skip to content

video: firmware: Add multi-kernel PAS API compatibility#99

Open
venvenk wants to merge 1 commit intoqualcomm-linux:video.qclinux.mainfrom
gouravk-qualcomm:kvm-overlay
Open

video: firmware: Add multi-kernel PAS API compatibility#99
venvenk wants to merge 1 commit intoqualcomm-linux:video.qclinux.mainfrom
gouravk-qualcomm:kvm-overlay

Conversation

@venvenk
Copy link
Copy Markdown
Contributor

@venvenk venvenk commented Apr 30, 2026

The iris video driver currently supports only the Qualcomm kernel PAS context API. This patch extends firmware loading to support multiple kernel variants.

The appropriate code path is selected at compile time via preprocessor macros set by the build system.

@gouravk-qualcomm
Copy link
Copy Markdown

gouravk-qualcomm commented May 2, 2026

@lumag Requesting your review.
This change enables building the overlay driver with upstream kernels.
The flags used here will be configured by iris-video-dlkm_1.0.8.bb based on the prototype shown below and will be included in the v1.0.8 tag.

image

All code changes are ready and validated, will be included in iris-video-dlkm_1.0.8.bb.

@lumag
Copy link
Copy Markdown
Contributor

lumag commented May 2, 2026

No, that's a very bad idea. Check for the features/API rather than particular versions.

Comment thread driver/vidc/src/firmware.c Outdated
const char *fw_name,
phys_addr_t phys, size_t res_size)
{
#if defined(HAS_YOCTO_6_18)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaghetti code in the functions. If you need, put the whole function in the if block.

@gouravk-qualcomm
Copy link
Copy Markdown

gouravk-qualcomm commented May 2, 2026

No, that's a very bad idea. Check for the features/API rather than particular versions.

@lumag in Yocto build there is no direct provision to scan code of one recipe from another.

Current Approach :

python () {
    kernel_provider = d.getVar('PREFERRED_PROVIDER_virtual/kernel') or ''

    if 'linux-yocto' in kernel_provider:
        if 'dev' in kernel_provider:
            cflags_value = '-DHAS_YOCTO_DEV'
        else:
            cflags_value = '-DHAS_YOCTO_6_18'

        d.appendVar('EXTRA_OEMAKE', f' KCFLAGS="{cflags_value}"')
}

@lumag could you please elaborate on this approach if there is any other way to check for features/API instead?

@lumag
Copy link
Copy Markdown
Contributor

lumag commented May 2, 2026

@lumag could you please elaborate on this approach if there is any other way to check for features/API instead?

Yes. Use the C preprocessing and source-level checks. If that's not enough, check from the Makefile. For example, see how it's done in the Nvidia graphics driver.

@lumag
Copy link
Copy Markdown
Contributor

lumag commented May 2, 2026

Basically, you are trying to adapt the code to the patched Yocto 6.18 kernel. This is wrong. It will mean nothing if one tries building against a Debian, Fedora or patched mainline. Instead you must be checking for the source code features. Use kernel version checks, Kconfig symbols, presence of the defines in the include files, etc.

The iris video driver currently supports only the Qualcomm kernel
PAS context API. This patch extends firmware loading to support
multiple kernel variants.

The appropriate code path is selected at compile time via
macros set by the build system.

Signed-off-by: Gourav Kumar <gouravk@qti.qualcomm.com>
@gouravk-qualcomm
Copy link
Copy Markdown

@lumag Source-level checks have been implemented. Requesting your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants