Introduce finish_drm

For now it just closes the DRM FD, but will do more soon.
This commit is contained in:
Simon Ser 2021-09-10 11:05:09 +02:00
parent fc748ebd78
commit ff8c0b183b
3 changed files with 9 additions and 0 deletions

View file

@ -607,6 +607,12 @@ int init_drm(struct drm_t *drm, const char *device_name)
return 0;
}
void finish_drm(struct drm_t *drm)
{
close(drm->fd);
drm->fd = -1;
}
static int add_property(drmModeAtomicReq *req, uint32_t obj_id, std::map<std::string, const drmModePropertyRes *> &props, const char *name, uint64_t value)
{
if ( props.count( name ) == 0 )

View file

@ -125,6 +125,7 @@ extern bool g_bDebugLayers;
extern const char *g_sOutputName;
int init_drm(struct drm_t *drm, const char *device);
void finish_drm(struct drm_t *drm);
int drm_commit(struct drm_t *drm, struct Composite_t *pComposite, struct VulkanPipeline_t *pPipeline );
int drm_prepare( struct drm_t *drm, const struct Composite_t *pComposite, const struct VulkanPipeline_t *pPipeline );
bool drm_poll_state(struct drm_t *drm);

View file

@ -3852,4 +3852,6 @@ steamcompmgr_main (int argc, char **argv)
statsThreadRun = false;
statsThreadSem.signal();
}
finish_drm( &g_DRM );
}