Skip to content

refpolicy-targeted: allow qcom_nhx to access the kgsl GPU node - #3551

Merged
Dmitry Baryshkov (lumag) merged 1 commit into
qualcomm-linux:masterfrom
rohibira-qipl:camera_upstream_v2
Nov 28, 2026
Merged

Dmitry Baryshkov (lumag) merged 1 commit into
qualcomm-linux:masterfrom
rohibira-qipl:camera_upstream_v2

Conversation

@rohibira-qipl

@rohibira-qipl rohibira-qipl commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

On Shikra, the camera software resizes frames on the GPU, which is the
first GPU-based solution in QLI. It relies on Qualcomm's Adreno OpenCL
implementation, which needs /dev/kgsl-3d0. The nativehaltest binary
runs in qcom_nhx_t, which is denied access to that node, so OpenCL
initialisation fails.

Allow qcom_nhx_t to access the GPU device node. Also add the rules
needed to silence the non-fatal denials seen when qti-cam-server.service
is stopped and started with systemctl.

Express every rule through refpolicy interfaces instead of raw allow
statements against types owned by other modules.

@github-actions

This comment has been minimized.

@test-reporting-app

test-reporting-app Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Test Results

  119 files    824 suites   8h 35m 13s ⏱️
  298 tests   295 ✅  3 💤 0 ❌
5 267 runs  5 237 ✅ 30 💤 0 ❌

Results for commit 1970fbb.

♻️ This comment has been updated with latest results.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 5b0e9e6

  • qcomdistro: multimedia image-prop
    Pass: 53 | Fail: 0 | Total: 53
  • qcomdistro: multimedia image
    Pass: 7 | Fail: 0 | Total: 7

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@lumag Dmitry Baryshkov (lumag) left a comment

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.

Please read contributing guidelines and write a sensible commit message. There is no need to repeat the patch contents in prose.

@rohibira-qipl rohibira-qipl changed the title refpolicy-targeted: Fix camera-nhx SELinux policy blocking kgsl GPU access refpolicy-targeted: allow qcom_nhx to access the kgsl GPU node Nov 16, 2026
@rohibira-qipl

Copy link
Copy Markdown
Contributor Author

Please read contributing guidelines and write a sensible commit message. There is no need to repeat the patch contents in prose.

Updated the commit message to explain the problem: Shikra camera GPU resize uses Adreno OpenCL, which needs /dev/kgsl-3d0, and SELinux denied it.

@lumag Dmitry Baryshkov (lumag) left a comment

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.

Will it work if OpenCL is provided by Mesa rather than by the Adreno libs?

@rohibira-qipl

Copy link
Copy Markdown
Contributor Author

Will it work if OpenCL is provided by Mesa rather than by the Adreno libs?

No. This is specific to Adreno OpenCL, which needs /dev/kgsl-3d0. Mesa isn't supported by the KGSL driver.

@github-actions

This comment has been minimized.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit a277f4a

  • qcomdistro: multimedia image-prop
    Pass: 52 | Fail: 1 | Total: 53
  • qcomdistro: multimedia image
    Pass: 7 | Fail: 0 | Total: 7

@rohibira-qipl

Copy link
Copy Markdown
Contributor Author

Dmitry Baryshkov (@lumag) could you please review this PR

@lumag

Copy link
Copy Markdown
Contributor

Will it work if OpenCL is provided by Mesa rather than by the Adreno libs?

No. This is specific to Adreno OpenCL, which needs /dev/kgsl-3d0. Mesa isn't supported by the KGSL driver.

Does Camera on Shikra require Adreno OpenCL or will CamX work with Mesa?

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 9022b29

  • qcomdistro: multimedia image-prop
    Pass: 52 | Fail: 0 | Total: 52
  • qcomdistro: multimedia image
    Pass: 6 | Fail: 0 | Total: 6

On Shikra, the camera software resizes frames on the GPU, which is the
first GPU-based solution in QLI. It relies on Qualcomm's Adreno OpenCL
implementation, which needs /dev/kgsl-3d0. The nativehaltest binary
runs in qcom_nhx_t, which is denied access to that node, so OpenCL
initialisation fails.

Allow qcom_nhx_t to access the GPU device node. Also add the rules
needed to silence the non-fatal denials seen when qti-cam-server.service
is stopped and started with systemctl.

Express every rule through refpolicy interfaces instead of raw allow
statements against types owned by other modules.

Signed-off-by: Rohit Biradar <[email protected]>
@lumag

Copy link
Copy Markdown
Contributor

Will it work if OpenCL is provided by Mesa rather than by the Adreno libs?

No. This is specific to Adreno OpenCL, which needs /dev/kgsl-3d0. Mesa isn't supported by the KGSL driver.

Does Camera on Shikra require Adreno OpenCL or will CamX work with Mesa?

Still unanswered. If CamX can work with Mesa OpenCL implementation, then we also need to allow access to DRI devices

@quic-varugula

Copy link
Copy Markdown

Will it work if OpenCL is provided by Mesa rather than by the Adreno libs?

No. This is specific to Adreno OpenCL, which needs /dev/kgsl-3d0. Mesa isn't supported by the KGSL driver.

Does Camera on Shikra require Adreno OpenCL or will CamX work with Mesa?

Still unanswered. If CamX can work with Mesa OpenCL implementation, then we also need to allow access to DRI devices

At this point of time, CamX can't work with Mesa OpenCL implementation, But works only with Adreno based GPU Solution.

@rohibira-qipl

Copy link
Copy Markdown
Contributor Author

Ricardo Salveti (@ricardosalveti) could you please review this PR.

@github-actions

This comment has been minimized.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 1970fbb

  • qcomdistro: multimedia image
    Pass: 6 | Fail: 0 | Total: 6
  • qcomdistro: multimedia image-prop
    Pass: 51 | Fail: 0 | Total: 51

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Test run workflow

Test jobs for commit 1970fbb

nodistro

Pass: 10 | Fail: 0 | Total: 10

qcom-distro

Pass: 403 | Fail: 9 | Total: 425

qcom-distro_kernel-fit

Pass: 1 | Fail: 0 | Total: 1

qcom-distro_linux-qcom-6.18

Pass: 285 | Fail: 0 | Total: 302

@lumag
Dmitry Baryshkov (lumag) merged commit 6c0c59f into qualcomm-linux:master Nov 28, 2026
247 checks passed
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.

6 participants