mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
Buffer objects held by the amdgpu drm driver are checkpointed with the new BO_INFO and MAPPING_INFO ioctls/ioctl options. Handling is in amdgpu_plugin_drm.h Handling of imported buffer objects may require dmabuf fds to be transferred between processes. These occur over fdstore, with the handle-fstore id relationships kept in shread memory. There is a new plugin callback: RESTORE_INIT to create the shared memory. During checkpoint, track shared buffer objects, so that buffer objects that are shared across processes can be identified. During restore, track which buffer objects have been restored. Retry restore of a drm file if a buffer object is imported and the original has not been exported yet. Skip buffer objects that have already been completed or cannot be completed in the current restore. So drm code can use sdma_copy_bo, that function no longer requires kfd bo structs Update the protobuf messages with new amdgpu drm information. Signed-off-by: David Francis <David.Francis@amd.com>
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
#ifndef __AMDGPU_PLUGIN_DRM_H__
|
|
#define __AMDGPU_PLUGIN_DRM_H__
|
|
|
|
#include <dirent.h>
|
|
#include "common/list.h"
|
|
|
|
#include "xmalloc.h"
|
|
#include "criu-log.h"
|
|
#include "kfd_ioctl.h"
|
|
#include "amdgpu_plugin_util.h"
|
|
#include "amdgpu_plugin_topology.h"
|
|
|
|
|
|
/**
|
|
* Determines if VMA's of input file descriptor belong to amdgpu's
|
|
* DRM device and are therefore supported
|
|
*/
|
|
int amdgpu_plugin_drm_handle_device_vma(int fd, const struct stat *drm);
|
|
|
|
/**
|
|
* Serialize meta-data about a particular DRM device, its number of BOs,
|
|
* etc into a file. The serialized filename has in it the value ID that
|
|
* is passed in as a parameter
|
|
*/
|
|
int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm);
|
|
|
|
int amdgpu_plugin_drm_restore_file(int fd, CriuRenderNode *rd);
|
|
|
|
int amdgpu_plugin_drm_unpause_file(int fd);
|
|
|
|
int amdgpu_id_for_handle(int handle);
|
|
|
|
int store_dmabuf_fd(int handle, int fd);
|
|
|
|
int get_gem_handle(amdgpu_device_handle h_dev, int dmabuf_fd);
|
|
|
|
int save_vma_updates(uint64_t offset, uint64_t addr, uint64_t restored_offset, int gpu_id);
|
|
|
|
#endif /* __AMDGPU_PLUGIN_DRM_H__ */
|
|
|