Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.1k
    • Issues 3.1k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1k
    • Merge requests 1k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MesaMesa
  • mesamesa
  • Merge requests
  • !13154

iris: Fix a bug in the code to unsuballocate a resource for export, and simplify it

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Kenneth Graunke requested to merge kwg/mesa:iris-suballoc-flush-resource into main Oct 01, 2021
  • Overview 8
  • Commits 3
  • Pipelines 2
  • Changes 1

@daenzer mentioned on IRC the other night that attempting to export a resource not marked PIPE_BIND_SHARED is a bug. We were hitting that case with Piglit's ext_image_dma_buf_import/export-tex, which did:

  1. glTexStorage2D (make a texture, allocate storage, upload data)
  2. eglCreateImageKHR (turn the texture into an EGL image)
  3. eglExportDMABUFImageMESA (export it)

The first step suballocates the texture because we have no idea it'll be used externally at that moment. Previously, iris was following the radeonsi approach and transitioning it to a dedicated (non-suballocated) resource at step 3, when dri_query_image requests a handle. This is a bit painful as dri_query_image doesn't give us a context to work with, and we need one.

This series moves the transition point to step 2. eglCreateImageKHR calls pipe->flush_resource(), which already does some aux-disabling in preparation for sharing an image externally. Now, we also un-suballocate it there. This point in time has a context, so we don't need the whole "make a temporary context" stuff.

This seems to happen a bit more frequently, as it comes up in a couple extra EGL dmabuf Piglit tests. On the plus side, this testing exposed a simple bug: We had accidentally passed <x, y, z, l> instead of <l, x, y, z>. We fix that here too.

+@pzanoni

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: iris-suballoc-flush-resource