Skip to content

Commit

Permalink
UI: remove unused lock and fence (commaai#24355)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwooning committed May 2, 2022
1 parent 39cf862 commit 7ac9293
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions selfdrive/ui/qt/widgets/cameraview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,9 @@ void CameraViewWidget::paintGL() {
glClearColor(bg.redF(), bg.greenF(), bg.blueF(), bg.alphaF());
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

std::lock_guard lk(lock);

if (latest_frame == nullptr) return;

glViewport(0, 0, width(), height());
// sync with the PBO
if (wait_fence) {
wait_fence->wait();
}

glBindVertexArray(frame_vao);

glUseProgram(program->programId());
Expand Down
9 changes: 0 additions & 9 deletions selfdrive/ui/qt/widgets/cameraview.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,10 @@ class CameraViewWidget : public QOpenGLWidget, protected QOpenGLFunctions {
virtual void updateFrameMat(int w, int h);
void vipcThread();

struct WaitFence {
WaitFence() { sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); }
~WaitFence() { glDeleteSync(sync); }
void wait() { glWaitSync(sync, 0, GL_TIMEOUT_IGNORED); }
GLsync sync = 0;
};

bool zoomed_view;
std::mutex lock;
VisionBuf *latest_frame = nullptr;
GLuint frame_vao, frame_vbo, frame_ibo;
mat4 frame_mat;
std::unique_ptr<WaitFence> wait_fence;
std::unique_ptr<QOpenGLShaderProgram> program;
QColor bg = QColor("#000000");

Expand Down

0 comments on commit 7ac9293

Please sign in to comment.