[client] egl: revert "only copy damaged areas when using dmabuf"

This reverts commit a14de25661.
Frame is sometimes incorrect.
This commit is contained in:
Quantum
2021-07-18 04:42:48 -04:00
committed by Geoffrey McRae
parent a14de25661
commit c6a6230a56
7 changed files with 18 additions and 35 deletions

View File

@@ -27,7 +27,6 @@
#include "texture.h"
#include "shader.h"
#include "model.h"
#include "util.h"
#include <stdlib.h>
#include <string.h>
@@ -260,16 +259,11 @@ bool egl_desktop_setup(EGL_Desktop * desktop, const LG_RendererFormat format, bo
return true;
}
bool egl_desktop_update(EGL_Desktop * desktop, const FrameBuffer * frame, int dmaFd,
const FrameDamageRect * origRects, int rectsCount)
bool egl_desktop_update(EGL_Desktop * desktop, const FrameBuffer * frame, int dmaFd)
{
FrameDamageRect rects[KVMFR_MAX_DAMAGE_RECTS];
memcpy(rects, origRects, rectsCount * sizeof(FrameDamageRect));
rectsCount = util_mergeOverlappingRects(rects, rectsCount);
if (dmaFd >= 0)
{
if (!egl_texture_update_from_dma(desktop->texture, frame, dmaFd, rects, rectsCount))
if (!egl_texture_update_from_dma(desktop->texture, frame, dmaFd))
return false;
}
else

View File

@@ -22,7 +22,6 @@
#include <stdbool.h>
#include "common/types.h"
#include "interface/renderer.h"
typedef struct EGL_Desktop EGL_Desktop;
@@ -41,8 +40,7 @@ bool egl_desktop_init(EGL_Desktop ** desktop, EGLDisplay * display);
void egl_desktop_free(EGL_Desktop ** desktop);
bool egl_desktop_setup (EGL_Desktop * desktop, const LG_RendererFormat format, bool useDMA);
bool egl_desktop_update(EGL_Desktop * desktop, const FrameBuffer * frame, int dmaFd,
const FrameDamageRect * rects, int rectsCount);
bool egl_desktop_update(EGL_Desktop * desktop, const FrameBuffer * frame, int dmaFd);
bool egl_desktop_render(EGL_Desktop * desktop, const float x, const float y,
const float scaleX, const float scaleY, enum EGL_DesktopScaleType scaleType,
LG_RendererRotate rotate);

View File

@@ -583,7 +583,7 @@ bool egl_on_frame(void * opaque, const FrameBuffer * frame, int dmaFd,
{
struct Inst * this = (struct Inst *)opaque;
if (!egl_desktop_update(this->desktop, frame, dmaFd, damageRects, damageRectsCount))
if (!egl_desktop_update(this->desktop, frame, dmaFd))
{
DEBUG_INFO("Failed to to update the desktop");
return false;

View File

@@ -388,8 +388,7 @@ bool egl_texture_update_from_frame(EGL_Texture * texture, const FrameBuffer * fr
return true;
}
bool egl_texture_update_from_dma(EGL_Texture * texture, const FrameBuffer * frame, const int dmaFd,
const FrameDamageRect * rects, int rectsCount)
bool egl_texture_update_from_dma(EGL_Texture * texture, const FrameBuffer * frame, const int dmaFd)
{
if (!texture->streaming)
return false;
@@ -471,15 +470,7 @@ bool egl_texture_update_from_dma(EGL_Texture * texture, const FrameBuffer * fram
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->dmaTex, 0);
glBindTexture(GL_TEXTURE_2D, texture->tex[0]);
if (!texture->ready || rectsCount == 0)
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texture->width, texture->height);
else
{
for (int i = 0; i < rectsCount; ++i)
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, rects[i].x, rects[i].y, rects[i].x, rects[i].y,
rects[i].width, rects[i].height);
}
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texture->width, texture->height);
GLsync fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
glFlush();

View File

@@ -23,7 +23,6 @@
#include <stdbool.h>
#include "shader.h"
#include "common/framebuffer.h"
#include "common/types.h"
#include <GL/gl.h>
#include <EGL/egl.h>
@@ -53,7 +52,7 @@ void egl_texture_free(EGL_Texture ** tex);
bool egl_texture_setup (EGL_Texture * texture, enum EGL_PixelFormat pixfmt, size_t width, size_t height, size_t stride, bool streaming, bool useDMA);
bool egl_texture_update (EGL_Texture * texture, const uint8_t * buffer);
bool egl_texture_update_from_frame(EGL_Texture * texture, const FrameBuffer * frame);
bool egl_texture_update_from_dma (EGL_Texture * texture, const FrameBuffer * frmame, const int dmaFd, const FrameDamageRect * rects, int rectsCount);
bool egl_texture_update_from_dma (EGL_Texture * texture, const FrameBuffer * frmame, const int dmaFd);
enum EGL_TexStatus egl_texture_process(EGL_Texture * texture);
enum EGL_TexStatus egl_texture_bind (EGL_Texture * texture);
int egl_texture_count (EGL_Texture * texture);