Mesa (main): gbm: Remove stat and refcount fields from gbm_device

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 6 17:27:20 UTC 2021


Module: Mesa
Branch: main
Commit: c5e849bddf24e39717e16599e5a25c082bc80f1f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c5e849bddf24e39717e16599e5a25c082bc80f1f

Author: James Jones <jajones at nvidia.com>
Date:   Tue Jun  1 17:35:27 2021 -0700

gbm: Remove stat and refcount fields from gbm_device

These were unused.

Signed-off-by: James Jones <jajones at nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>

---

 src/gbm/main/gbm.c    | 6 +-----
 src/gbm/main/gbmint.h | 3 ---
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c
index e4c7d95f829..ce74738b1c9 100644
--- a/src/gbm/main/gbm.c
+++ b/src/gbm/main/gbm.c
@@ -106,9 +106,7 @@ gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm,
 GBM_EXPORT void
 gbm_device_destroy(struct gbm_device *gbm)
 {
-   gbm->refcount--;
-   if (gbm->refcount == 0)
-      gbm->destroy(gbm);
+   gbm->destroy(gbm);
 }
 
 /** Create a gbm device for allocating buffers
@@ -139,8 +137,6 @@ gbm_create_device(int fd)
       return NULL;
 
    gbm->dummy = gbm_create_device;
-   gbm->stat = buf;
-   gbm->refcount = 1;
 
    return gbm;
 }
diff --git a/src/gbm/main/gbmint.h b/src/gbm/main/gbmint.h
index ded76793a2c..7514e03ffd7 100644
--- a/src/gbm/main/gbmint.h
+++ b/src/gbm/main/gbmint.h
@@ -29,7 +29,6 @@
 #define INTERNAL_H_
 
 #include "gbm.h"
-#include <sys/stat.h>
 
 /* GCC visibility */
 #if defined(__GNUC__)
@@ -54,8 +53,6 @@ struct gbm_device {
 
    int fd;
    const char *name;
-   unsigned int refcount;
-   struct stat stat;
 
    void (*destroy)(struct gbm_device *gbm);
    int (*is_format_supported)(struct gbm_device *gbm,



More information about the mesa-commit mailing list