include:
  - local: 'src/freedreno/ci/gitlab-ci-inc.yml'

a306_gl:
  extends:
    - .baremetal-deqp-test
    - .a306-test
  variables:
    DEQP_SUITE: freedreno-a307
    FDO_CI_CONCURRENT: 6
  parallel: 5

a306_piglit:
  extends:
    - .baremetal-deqp-test
    - .a306-test
    - .google-freedreno-manual-rules
  timeout: 40m
  variables:
    DEQP_SUITE: freedreno-a306-piglit
    HWCI_START_WESTON: 1
    TEST_PHASE_TIMEOUT_MINUTES: 35

# Something happened and now this hangchecks and doesn't recover.  Unkown when
# it started.
.a306_piglit_gl:
  extends:
    - .baremetal-deqp-test
    - .a306-test
    - .google-freedreno-manual-rules
  variables:
    BM_KERNEL_EXTRA_ARGS: "msm.num_hw_submissions=1"
    DEQP_SUITE: freedreno-a306-piglit-quick-gl
    FDO_CI_CONCURRENT: 3
    HWCI_START_WESTON: 1

a306_piglit_shader:
  extends:
    - .baremetal-deqp-test
    - .a306-test
    - .google-freedreno-manual-rules
  variables:
    DEQP_SUITE: freedreno-a306-piglit-quick-shader
    FDO_CI_CONCURRENT: 6
    HWCI_START_WESTON: 1

a306-traces:
  extends:
    - .google-freedreno-test-traces
    - .a306-test
  variables:
    PIGLIT_REPLAY_DEVICE_NAME: "freedreno-a306"
    PIGLIT_RESULTS: "freedreno-a306-replay"

a530_gl:
  extends:
    - .baremetal-deqp-test
    - .a530-test
  variables:
    DEQP_SUITE: freedreno-a530
    FDO_CI_CONCURRENT: 3  # if 4, sometimes "deqp-gles31, not enough memory for the allocation" appears
  parallel: 6

a530-traces:
  extends:
    - .google-freedreno-test-traces
    - .a530-test
  variables:
    PIGLIT_REPLAY_DEVICE_NAME: "freedreno-a530"
    PIGLIT_RESULTS: "freedreno-a530-replay"

a530_piglit:
  extends:
    - .baremetal-deqp-test
    - .a530-test
    - .google-freedreno-manual-rules
  parallel: 2
  variables:
    DEQP_SUITE: freedreno-a530-piglit
    HWCI_START_WESTON: 1
    # force fixed kernel until 6.11 is switched officially
    FORCE_KERNEL_TAG: "v6.11-rc7-mesa-73f2"
    KERNEL_IMAGE_BASE: https://${S3_HOST}/${S3_KERNEL_BUCKET}/${KERNEL_REPO}/${FORCE_KERNEL_TAG}

a618_vk:
  extends:
    - .lava-test-deqp:arm64
    - .lava-sc7180-trogdor-kingoftown:arm64
    - .collabora-turnip-rules
  parallel: 12
  variables:
    DEQP_SUITE: freedreno-a618-vk
    FLAKES_CHANNEL: "#freedreno-ci"
    MESA_VK_IGNORE_CONFORMANCE_WARNING: 1
    DEQP_FRACTION: 2

a618_vk_full:
  extends:
    - a618_vk
    - .collabora-turnip-manual-rules
  # We use a longer timeout to keep the parallel down so that we don't lock up
  # too many runners for a long time when a dev is trying out at full VK status.
  timeout: 4h
  parallel: 3
  variables:
    # ran into OOM with VK-GL-CTS 1.2.8.0 at 6
    FDO_CI_CONCURRENT: 4
    DEQP_SUITE: freedreno-a618-vk-full
    JOB_TIMEOUT: 180

a618_gl:
  extends:
    - .lava-test-deqp:arm64
    - .lava-sc7180-trogdor-lazor-limozeen:arm64
    - .collabora-freedreno-rules
  parallel: 4
  variables:
    DEQP_SUITE: freedreno-a618
    FLAKES_CHANNEL: "#freedreno-ci"

# Run dEQP EGL window system tests separately with the window systems available.
# X11 takes over the screen, wayland is run headless.
a618_egl:
  extends:
    - .lava-test-deqp:arm64
    - .lava-sc7180-trogdor-lazor-limozeen:arm64
    - .collabora-freedreno-rules
  variables:
    DEQP_VER: egl
    FLAKES_CHANNEL: "#freedreno-ci"
    HWCI_START_XORG: 1
    HWCI_START_WESTON: 1
    DEQP_SUITE: freedreno-a618-egl

a618_skqp:
  extends:
    - .lava-test-deqp:arm64
    - .lava-sc7180-trogdor-lazor-limozeen:arm64
    - .collabora-freedreno-rules
    # SKQP tests both the GL and VK drivers.
    - .collabora-freedreno-turnip-rules
  variables:
    FLAKES_CHANNEL: "#freedreno-ci"
    HWCI_START_XORG: 1
    DEQP_SUITE: freedreno-a618-skqp

a618_piglit:
  extends:
    - .lava-test-deqp:arm64
    - .lava-sc7180-trogdor-lazor-limozeen:arm64
    # Note that piglit has GL+VK integration testing.
    - .collabora-freedreno-turnip-rules
  variables:
    DEQP_SUITE: freedreno-a618-piglit
    FLAKES_CHANNEL: "#freedreno-ci"
    HWCI_START_WESTON: 1

a618_piglit_full:
  extends:
    - .lava-test-deqp:arm64
    - .lava-sc7180-trogdor-lazor-limozeen:arm64
    # Note that piglit has GL+VK integration testing.
    - .collabora-freedreno-turnip-manual-rules
  timeout: 60m
  variables:
    DEQP_SUITE: freedreno-a618-piglit-full
    FLAKES_CHANNEL: "#freedreno-ci"
    HWCI_START_WESTON: 1
    JOB_TIMEOUT: 60

a618-traces:
  extends:
    - .lava-piglit-traces:arm64
    - .lava-sc7180-trogdor-lazor-limozeen:arm64
    - .collabora-freedreno-rules
  variables:
    HWCI_START_WESTON: 1
    # So we aren't capped by VSync by the X server
    EGL_PLATFORM: surfaceless
    FDO_CI_CONCURRENT: 5  # 6 is too much leading to OOM
    FLAKES_CHANNEL: "#freedreno-ci"
    PIGLIT_REPLAY_DEVICE_NAME: "${GPU_VERSION}"
    PIGLIT_RESULTS: "${GPU_VERSION}-replay"
    # This lets us run several more traces which don't use any features we're
    # missing.
    MESA_GLSL_VERSION_OVERRIDE: "460"
    MESA_GL_VERSION_OVERRIDE: "4.6"
    PIGLIT_TRACES_FILE: traces-freedreno.yml

a618-traces-performance:
  extends:
    - a618-traces
    - .piglit-performance:arm64
    - .collabora-freedreno-rules-performance
  variables:
    # Always use the same device
    # a618 tag starts with cbg-1 (not cbg-0) for some reason
    LAVA_TAGS: "cbg-1"
  needs:
    - !reference [a618-traces, needs]
    - !reference [.piglit-performance:arm64, needs]

a660_gl:
  extends:
    - .lava-test-deqp:arm64
    - .collabora-freedreno-rules
    - .lava-sm8350-hdk:arm64
  parallel: 2
  variables:
    DEQP_SUITE: freedreno-a660

a660_vk:
  extends:
    - .lava-test-deqp:arm64
    - .collabora-turnip-rules
    - .lava-sm8350-hdk:arm64
  parallel: 5
  variables:
    DEQP_SUITE: freedreno-a660-vk
    DEQP_FRACTION: 4

a660_vk_full:
  extends:
    - a660_vk
    - .collabora-turnip-manual-rules
  parallel: 3
  timeout: 3h
  variables:
    DEQP_SUITE: freedreno-a660-vk-full
    JOB_TIMEOUT: 180

# X11 takes over the screen, wayland is run headless.
a630_gl:
  extends:
    - .baremetal-deqp-test
    - .a630-test
  parallel: 4
  variables:
    DEQP_SUITE: freedreno-a630
    HWCI_START_XORG: 1
    HWCI_START_WESTON: 1

a630_gles_asan:
  extends:
    - .baremetal-deqp-test
    - .a630-test
    - .baremetal-arm64-asan-test
  variables:
    DEQP_VER: gles31
    DEQP_FRACTION: 100
    DEQP_EXPECTED_RENDERER: FD630
    FDO_CI_CONCURRENT: 2 # We get OOMkills if we go too wide with asan enabled
    GPU_VERSION: freedreno-a630-asan

a630_vk:
  extends:
    - .a630-test
    - .baremetal-deqp-test-freedreno-vk
    - .google-turnip-rules
  variables:
    DEQP_SUITE: freedreno-a630-vk

a630_vk_full:
  # We use a longer timeout (2 hour job) to keep the parallel down so that we
  # don't lock up too many runners for a long time when a dev is testing full VK
  # status.  The full runs are restricted to just 2 runners to keep from
  # blocking up normal merges, so going more parallel doesn't make any sense.
  timeout: 3h
  extends:
    - a630_vk
    - .a630-full
    - .google-turnip-manual-rules
  parallel: 2
  variables:
    DEQP_SUITE: freedreno-a630-vk-full
    TEST_PHASE_TIMEOUT_MINUTES: 175
    # force fixed kernel until 6.11 is switched officially
    FORCE_KERNEL_TAG: "v6.11-rc7-mesa-73f2"
    KERNEL_IMAGE_BASE: https://${S3_HOST}/${S3_KERNEL_BUCKET}/${KERNEL_REPO}/${FORCE_KERNEL_TAG}

a630_vk_asan:
  extends:
    - .a630-test
    - .baremetal-deqp-test-freedreno-vk
    - .baremetal-arm64-asan-test
    - .google-turnip-rules
  variables:
    DEQP_SUITE: freedreno-a630-vk-asan
    FDO_CI_CONCURRENT: 2 # We get OOMkills if we go too wide with asan enabled
    GPU_VERSION: freedreno-a630-asan

a630_piglit:
  extends:
    - .baremetal-deqp-test
    - .a630-test
    # Note that piglit has GL+VK integration testing.
    - .google-freedreno-turnip-rules
  variables:
    HWCI_START_WESTON: 1
    DEQP_SUITE: freedreno-a630-piglit

a630_piglit_full:
  extends:
    - .baremetal-deqp-test
    - .a630-test
    # Note that piglit has GL+VK integration testing.
    - .google-freedreno-turnip-manual-rules
  timeout: 60m
  variables:
    HWCI_START_WESTON: 1
    DEQP_SUITE: freedreno-a630-piglit-full
    TEST_PHASE_TIMEOUT_MINUTES: 55

a630-traces:
  extends:
    - .google-freedreno-test-traces
    - .a630-test
  variables:
    PIGLIT_REPLAY_DEVICE_NAME: "freedreno-a630"
    PIGLIT_RESULTS: "freedreno-a630-replay"
    # This lets us run several more traces which don't use any features we're
    # missing.
    MESA_GLSL_VERSION_OVERRIDE: "460"
    MESA_GL_VERSION_OVERRIDE: "4.6"
    PIGLIT_REPLAY_EXTRA_ARGS: "--download-caching-proxy-url=http://10.42.0.1:8888/cache/?uri="

a630-traces-restricted:
  extends:
    - a630-traces
    - .google-freedreno-rules-restricted
  variables:
    PIGLIT_TRACES_FILE: restricted-traces-freedreno.yml
    PIGLIT_REPLAY_EXTRA_ARGS: "--download-caching-proxy-url=http://10.42.0.1:8888/cache/?uri= --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=${S3_TRACIE_PRIVATE_BUCKET} --jwt-file=${S3_JWT_FILE}"
  allow_failure: true

a630-traces-performance:
  extends:
    - a630-traces
    - .google-freedreno-rules-performance
  variables:
    PIGLIT_REPLAY_SUBCOMMAND: "profile"
    PIGLIT_REPLAY_EXTRA_ARGS: "--download-caching-proxy-url=http://10.42.0.1:8888/cache/?uri= --db-path ${CI_PROJECT_DIR}/replayer-db/"
    # More than this can hit OOM due to BOs leaked during the replay of the last frame
    PIGLIT_REPLAY_LOOP_TIMES: 150
    # We don't want for more than one workload to be submitted to the GPU at a time
    FDO_CI_CONCURRENT: 1
    # Piglit is very sparse in its status output and downloads of big traces can take a while
    DEVICE_HANGING_TIMEOUT_SEC: 600
    # So we aren't capped by VSync by the X server
    EGL_PLATFORM: surfaceless
    GIT_STRATEGY: none
    HWCI_FREQ_MAX: "true"

a750_vk:
  extends:
    - .b2c-freedreno-vk-test
    - .a750-mupuf
    - .valve-freedreno-turnip-manual-rules
  timeout: 60m  # base runtime 36min total, 34min of testing
  variables:
    B2C_TIMEOUT_BOOT_MINUTES: 52
    B2C_TIMEOUT_OVERALL_MINUTES: 55
    DEQP_SUITE: freedreno-a750-vk
    HWCI_TEST_SCRIPT: ./install/deqp-runner.sh

a750_vkd3d:
  extends:
    - .b2c-freedreno-vk-test
    - .a750-mupuf
    - .valve-freedreno-turnip-manual-rules
  timeout: 15m  # base runtime 3min
  variables:
    B2C_TIMEOUT_OVERALL_MINUTES: 12
    B2C_TIMEOUT_BOOT_MINUTES: 10
    HWCI_TEST_SCRIPT: install/vkd3d-runner.sh
    GPU_VERSION: freedreno-a750
    FDO_CI_CONCURRENT: 1
