etnaviv: Fix incorrect pipe_nn creation

When etna_screen_create(..) is called with gpu != NULL and npu == NULL,
screen->pipe_nn is incorrectly set up. This leads to an unintended
stream configuration for compute-only contexts, as determined by

  pipe = (compute_only && screen->pipe_nn) ? screen->pipe_nn : screen->pipe;

To address this, extend the gpu != npu condition by adding a check for
npu != NULL to ensure pipe_nn is only initialized when both gpu and npu
are provided.

Fixes: a4653587cc ("etnaviv: Add a separate NPU pipe")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32025>
This commit is contained in:
Christian Gmeiner
2024-11-07 10:28:00 +01:00
committed by Marge Bot
parent 9f5ee44986
commit f4e8849d79

View File

@@ -1105,7 +1105,7 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu,
goto fail;
}
if (gpu != npu) {
if (npu && gpu != npu) {
screen->pipe_nn = etna_pipe_new(npu, ETNA_PIPE_3D);
if (!screen->pipe_nn) {
DBG("could not create nn pipe");