mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-05-26 15:26:12 +00:00
refactoring
This commit is contained in:
@@ -162,8 +162,8 @@ int us_drm_open(us_drm_s *drm, const us_device_s *dev) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run->unplugged_reported = false;
|
run->unplugged_reported = false;
|
||||||
run->stub = (stub > 0);
|
run->opened_for_stub = (stub > 0);
|
||||||
_D_LOG_INFO("Opened for %s ...", (run->stub ? "STUB" : "DMA"));
|
_D_LOG_INFO("Opened for %s ...", (run->opened_for_stub ? "STUB" : "DMA"));
|
||||||
return stub;
|
return stub;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -298,7 +298,7 @@ int us_drm_expose_stub(us_drm_s *drm, us_drm_stub_e stub, const us_device_s *dev
|
|||||||
us_drm_runtime_s *const run = drm->run;
|
us_drm_runtime_s *const run = drm->run;
|
||||||
|
|
||||||
assert(run->fd >= 0);
|
assert(run->fd >= 0);
|
||||||
assert(run->stub);
|
assert(run->opened_for_stub);
|
||||||
|
|
||||||
switch (_drm_check_status(drm)) {
|
switch (_drm_check_status(drm)) {
|
||||||
case 0: break;
|
case 0: break;
|
||||||
@@ -367,7 +367,7 @@ int us_drm_expose_dma(us_drm_s *drm, const us_hw_buffer_s *hw) {
|
|||||||
us_drm_buffer_s *const buf = &run->bufs[hw->buf.index];
|
us_drm_buffer_s *const buf = &run->bufs[hw->buf.index];
|
||||||
|
|
||||||
assert(run->fd >= 0);
|
assert(run->fd >= 0);
|
||||||
assert(!run->stub);
|
assert(!run->opened_for_stub);
|
||||||
|
|
||||||
switch (_drm_check_status(drm)) {
|
switch (_drm_check_status(drm)) {
|
||||||
case 0: break;
|
case 0: break;
|
||||||
|
|||||||
@@ -62,11 +62,11 @@ typedef struct {
|
|||||||
uint n_bufs;
|
uint n_bufs;
|
||||||
drmModeCrtc *saved_crtc;
|
drmModeCrtc *saved_crtc;
|
||||||
int dpms_state;
|
int dpms_state;
|
||||||
|
bool opened_for_stub;
|
||||||
bool has_vsync;
|
bool has_vsync;
|
||||||
uint stub_n_buf;
|
uint stub_n_buf;
|
||||||
bool stub;
|
|
||||||
us_frametext_s *ft;
|
|
||||||
bool unplugged_reported;
|
bool unplugged_reported;
|
||||||
|
us_frametext_s *ft;
|
||||||
} us_drm_runtime_s;
|
} us_drm_runtime_s;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user