mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-07-24 18:35:58 +00:00
tests/pm_rpm: factor out drm_open_any_master
Signed-off-by: Imre Deak <imre.deak@intel.com>
This commit is contained in:
parent
781a0485ac
commit
bfda78cd33
@ -324,6 +324,25 @@ int drm_open_any(void)
|
|||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_open_any_master:
|
||||||
|
*
|
||||||
|
* Open an i915 drm legacy device node and ensure that it is drm master.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* The i915 drm file descriptor or -1 on error
|
||||||
|
*/
|
||||||
|
int drm_open_any_master(void)
|
||||||
|
{
|
||||||
|
int fd = drm_open_any();
|
||||||
|
|
||||||
|
igt_require(fd >= 0);
|
||||||
|
igt_require_f(drmSetMaster(fd) == 0, "Can't become DRM master, "
|
||||||
|
"please check if no other DRM client is running.\n");
|
||||||
|
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_open_any:
|
* drm_open_any:
|
||||||
*
|
*
|
||||||
|
@ -72,6 +72,7 @@ static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags,
|
|||||||
|
|
||||||
int drm_get_card(void);
|
int drm_get_card(void);
|
||||||
int drm_open_any(void);
|
int drm_open_any(void);
|
||||||
|
int drm_open_any_master(void);
|
||||||
int drm_open_any_render(void);
|
int drm_open_any_render(void);
|
||||||
|
|
||||||
void gem_quiescent_gpu(int fd);
|
void gem_quiescent_gpu(int fd);
|
||||||
|
@ -713,11 +713,7 @@ static void setup_non_graphics_runtime_pm(void)
|
|||||||
|
|
||||||
static void setup_environment(void)
|
static void setup_environment(void)
|
||||||
{
|
{
|
||||||
drm_fd = drm_open_any();
|
drm_fd = drm_open_any_master();
|
||||||
igt_assert(drm_fd >= 0);
|
|
||||||
|
|
||||||
igt_require_f(drmSetMaster(drm_fd) == 0, "Can't become DRM master, "
|
|
||||||
"please check if no other DRM client is running.\n");
|
|
||||||
|
|
||||||
init_mode_set_data(&ms_data);
|
init_mode_set_data(&ms_data);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user