Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevaev committed Mar 10, 2024
1 parent 6475eee commit 646afbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/v4p/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ int us_drm_open(us_drm_s *drm, const us_device_s *dev) {
}

run->unplugged_reported = false;
run->stub = (stub > 0);
_D_LOG_INFO("Opened for %s ...", (run->stub ? "STUB" : "DMA"));
run->opened_for_stub = (stub > 0);
_D_LOG_INFO("Opened for %s ...", (run->opened_for_stub ? "STUB" : "DMA"));
return stub;

error:
Expand Down Expand Up @@ -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;

assert(run->fd >= 0);
assert(run->stub);
assert(run->opened_for_stub);

switch (_drm_check_status(drm)) {
case 0: break;
Expand Down Expand Up @@ -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];

assert(run->fd >= 0);
assert(!run->stub);
assert(!run->opened_for_stub);

switch (_drm_check_status(drm)) {
case 0: break;
Expand Down
4 changes: 2 additions & 2 deletions src/v4p/drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ typedef struct {
uint n_bufs;
drmModeCrtc *saved_crtc;
int dpms_state;
bool opened_for_stub;
bool has_vsync;
uint stub_n_buf;
bool stub;
us_frametext_s *ft;
bool unplugged_reported;
us_frametext_s *ft;
} us_drm_runtime_s;

typedef struct {
Expand Down

0 comments on commit 646afbf

Please sign in to comment.