diff --git a/src/drm.cpp b/src/drm.cpp index 8d31369..21efa20 100644 --- a/src/drm.cpp +++ b/src/drm.cpp @@ -13,14 +13,9 @@ #include #include -extern "C" { -#include -} - #include "drm.hpp" #include "main.hpp" #include "vblankmanager.hpp" -#include "wlserver.hpp" #include "gpuvis_trace_utils.h" @@ -636,7 +631,7 @@ out: return ret; } -uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_buffer *buf, struct wlr_dmabuf_attributes *dma_buf ) +uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_dmabuf_attributes *dma_buf ) { assert( dma_buf->n_planes == 1); @@ -660,15 +655,7 @@ uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_buffer *buf, struct } assert( drm->map_fbid_inflightflips[ fb_id ].held == false ); - if ( buf != nullptr ) - { - wlserver_lock(); - buf = wlr_buffer_lock( buf ); - wlserver_unlock(); - } - drm->map_fbid_inflightflips[ fb_id ].id = fb_id; - drm->map_fbid_inflightflips[ fb_id ].buf = buf; drm->map_fbid_inflightflips[ fb_id ].held = true; drm->map_fbid_inflightflips[ fb_id ].n_refs = 0; @@ -685,13 +672,6 @@ static void drm_free_fb( struct drm_t *drm, struct fb *fb ) perror( "drmModeRmFB failed" ); } - if ( fb->buf != nullptr ) - { - wlserver_lock(); - wlr_buffer_unlock( fb->buf ); - wlserver_unlock(); - } - fb = {}; } diff --git a/src/drm.hpp b/src/drm.hpp index c1de439..27f9954 100644 --- a/src/drm.hpp +++ b/src/drm.hpp @@ -40,8 +40,6 @@ struct connector { struct fb { uint32_t id; - /* Client buffer, if any */ - struct wlr_buffer *buf; /* A FB is held if it's being used by steamcompmgr */ bool held; /* Number of page-flips using the FB */ @@ -99,6 +97,6 @@ extern bool g_bDebugLayers; int init_drm(struct drm_t *drm, const char *device, const char *mode_str, unsigned int vrefresh); int drm_atomic_commit(struct drm_t *drm, struct Composite_t *pComposite, struct VulkanPipeline_t *pPipeline ); -uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_buffer *buf, struct wlr_dmabuf_attributes *dma_buf ); +uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_dmabuf_attributes *dma_buf ); void drm_drop_fbid( struct drm_t *drm, uint32_t fbid ); bool drm_can_avoid_composite( struct drm_t *drm, struct Composite_t *pComposite, struct VulkanPipeline_t *pPipeline ); diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index ae3687b..509ec34 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -346,7 +346,6 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, VkFormat format, bo // We assume we own the memory when doing this right now. // We could support the import scenario as well if needed // assert( bTextureable == false ); - assert( pDMA == nullptr ); m_DMA.modifier = DRM_FORMAT_MOD_INVALID; m_DMA.n_planes = 1; @@ -376,7 +375,7 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, VkFormat format, bo m_DMA.stride[0] = image_layout.rowPitch; - m_FBID = drm_fbid_from_dmabuf( &g_DRM, nullptr, &m_DMA ); + m_FBID = drm_fbid_from_dmabuf( &g_DRM, &m_DMA ); if ( m_FBID == 0 ) return false; diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index 6c5cf29..4f2f97c 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -529,7 +529,7 @@ import_commit ( struct wlr_buffer *buf, struct wlr_dmabuf_attributes *dmabuf, co if ( BIsNested() == False ) { - commit.fb_id = drm_fbid_from_dmabuf( &g_DRM, buf, dmabuf ); + commit.fb_id = drm_fbid_from_dmabuf( &g_DRM, dmabuf ); assert( commit.fb_id != 0 ); }