Revert "st/dri2: Implement DRI2bufferDamageExtension"
authorBoris Brezillon <boris.brezillon@collabora.com>
Tue, 1 Oct 2019 14:24:27 +0000 (16:24 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Mon, 7 Oct 2019 09:38:26 +0000 (11:38 +0200)
This reverts commit 492ffbed63a2a62759224b1c7d45aa7923d8f542.

BACK_LEFT attachment can be outdated when the user calls
KHR_partial_update(), leading to a damage region update on the
wrong pipe_resource object.
Let's not expose the ->set_damage_region() method until the core is
fixed to handle that properly.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
src/gallium/drivers/panfrost/pan_screen.c
src/gallium/include/pipe/p_screen.h
src/gallium/state_trackers/dri/dri2.c

index 55c66e0c9a79155f69a15ca2992799ce7cc02c89..acc5b476316fe1fe3abb5ab1b1a28742e58684d7 100644 (file)
@@ -753,7 +753,6 @@ panfrost_create_screen(int fd, struct renderonly *ro)
         screen->base.get_compiler_options = panfrost_screen_get_compiler_options;
         screen->base.fence_reference = panfrost_fence_reference;
         screen->base.fence_finish = panfrost_fence_finish;
-        screen->base.set_damage_region = panfrost_resource_set_damage_region;
 
         panfrost_resource_screen_init(screen);
 
index 9a1fc37280e7f6909b779e12666f0378f349e017..a275a7c7900beec837bb54fa98b77d1a403fb87a 100644 (file)
@@ -483,23 +483,6 @@ struct pipe_screen {
    bool (*is_parallel_shader_compilation_finished)(struct pipe_screen *screen,
                                                    void *shader,
                                                    unsigned shader_type);
-
-   /**
-    * Set the damage region (called when KHR_partial_update() is invoked).
-    * This function is passed an array of rectangles encoding the damage area.
-    * rects are using the bottom-left origin convention.
-    * nrects = 0 means 'reset the damage region'. What 'reset' implies is HW
-    * specific. For tile-based renderers, the damage extent is typically set
-    * to cover the whole resource with no damage rect (or a 0-size damage
-    * rect). This way, the existing resource content is reloaded into the
-    * local tile buffer for every tile thus making partial tile update
-    * possible. For HW operating in immediate mode, this reset operation is
-    * likely to be a NOOP.
-    */
-   void (*set_damage_region)(struct pipe_screen *screen,
-                             struct pipe_resource *resource,
-                             unsigned int nrects,
-                             const struct pipe_box *rects);
 };
 
 
index 574ddaea5c78c95e38099e8e80b6c433de642d03..d42727c6cd6c0f8301ff1dc14051b88b9669d4b9 100644 (file)
@@ -1872,36 +1872,6 @@ static const __DRI2interopExtension dri2InteropExtension = {
    .export_object = dri2_interop_export_object
 };
 
-/**
- * \brief the DRI2bufferDamageExtension set_damage_region method
- */
-static void
-dri2_set_damage_region(__DRIdrawable *dPriv, unsigned int nrects, int *rects)
-{
-   struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct pipe_resource *resource = drawable->textures[ST_ATTACHMENT_BACK_LEFT];
-   struct pipe_screen *screen = resource->screen;
-   struct pipe_box *boxes = NULL;
-
-   if (nrects) {
-      boxes = CALLOC(nrects, sizeof(*boxes));
-      assert(boxes);
-
-      for (unsigned int i = 0; i < nrects; i++) {
-         int *rect = &rects[i * 4];
-
-         u_box_2d(rect[0], rect[1], rect[2], rect[3], &boxes[i]);
-      }
-   }
-
-   screen->set_damage_region(screen, resource, nrects, boxes);
-   FREE(boxes);
-}
-
-static __DRI2bufferDamageExtension dri2BufferDamageExtension = {
-   .base = { __DRI2_BUFFER_DAMAGE, 1 },
-};
-
 /**
  * \brief the DRI2ConfigQueryExtension configQueryb method
  */
@@ -2003,7 +1973,6 @@ static const __DRIextension *dri_screen_extensions[] = {
    &dri2GalliumConfigQueryExtension.base,
    &dri2ThrottleExtension.base,
    &dri2FenceExtension.base,
-   &dri2BufferDamageExtension.base,
    &dri2InteropExtension.base,
    &dri2NoErrorExtension.base,
    &driBlobExtension.base,
@@ -2019,7 +1988,6 @@ static const __DRIextension *dri_robust_screen_extensions[] = {
    &dri2ThrottleExtension.base,
    &dri2FenceExtension.base,
    &dri2InteropExtension.base,
-   &dri2BufferDamageExtension.base,
    &dri2Robustness.base,
    &dri2NoErrorExtension.base,
    &driBlobExtension.base,
@@ -2082,9 +2050,6 @@ dri2_init_screen(__DRIscreen * sPriv)
       }
    }
 
-   if (pscreen->set_damage_region)
-      dri2BufferDamageExtension.set_damage_region = dri2_set_damage_region;
-
    if (pscreen->get_param(pscreen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY)) {
       sPriv->extensions = dri_robust_screen_extensions;
       screen->has_reset_status_query = true;