New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windowing/gbm: cleanup and OO structure #13136
Conversation
xbmc/windowing/gbm/WinSystemGbm.h
Outdated
protected: | ||
CDRM m_DRM; | ||
CDRMUtils *m_DRM; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/gbm/DRMUtils.cpp
Outdated
{ | ||
return m_drm; | ||
return this; | ||
} |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/gbm/GBMUtils.cpp
Outdated
gbm->width = hdisplay; | ||
gbm->height = vdisplay; | ||
if (gbm->device) | ||
CLog::Log(LOGWARNING, "CGBMUtils::%s - device already created", __FUNCTION__); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/gbm/GBMUtils.cpp
Outdated
void CGBMUtils::DestroyDevice(struct gbm *gbm) | ||
{ | ||
if (!gbm->device) | ||
CLog::Log(LOGWARNING, "CGBMUtils::%s - device already destroyed", __FUNCTION__); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/gbm/GBMUtils.cpp
Outdated
bool CGBMUtils::CreateSurface(struct gbm *gbm, int width, int height) | ||
{ | ||
if (gbm->surface) | ||
CLog::Log(LOGWARNING, "CGBMUtils::%s - surface already created", __FUNCTION__); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/gbm/GBMUtils.cpp
Outdated
if (!gbm->surface) | ||
CLog::Log(LOGWARNING, "CGBMUtils::%s - surface already destroyed", __FUNCTION__); | ||
|
||
if (gbm->surface) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -23,7 +23,8 @@ | |||
#include "cores/VideoPlayer/VideoRenderers/RenderCapture.h" | |||
#include "cores/VideoPlayer/VideoRenderers/RenderFactory.h" | |||
#include "utils/log.h" | |||
#include "windowing/gbm/DRMUtils.h" | |||
|
|||
CWinSystemGbmGLESContext *CRendererDRMPRIME::m_pWinSystem = nullptr; | |||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -24,6 +24,7 @@ | |||
#include "cores/VideoPlayer/DVDStreamInfo.h" | |||
#include "cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h" | |||
#include "cores/VideoPlayer/Process/VideoBuffer.h" | |||
#include "windowing/gbm/WinSystemGbmGLESContext.h" | |||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -63,6 +64,8 @@ class CRendererDRMPRIME | |||
int m_iLastRenderBuffer = -1; | |||
static const int m_numRenderBuffers = 4; | |||
|
|||
static CWinSystemGbmGLESContext *m_pWinSystem; | |||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
moved CGBMUtils to OO structure as well. Please have a look @Kwiboo |
Looks good after a quick review on mobile, will test and look closer later tonight. There is an issue with Tinker Board where the last overlay plane is selected and not the first in current code, do you want a separate PR for a fix or include in this? |
@@ -193,8 +195,10 @@ void CRendererDRMPRIME::SetVideoPlane(CVideoBufferDRMPRIME* buffer) | |||
} | |||
} | |||
|
|||
buffer->m_drm_fd = drm->m_fd; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -166,13 +168,13 @@ void CRendererDRMPRIME::SetVideoPlane(CVideoBufferDRMPRIME* buffer) | |||
if (descriptor && descriptor->nb_layers) | |||
{ | |||
uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0}; | |||
struct drm* drm = CDRMUtils::GetDrm(); | |||
std::shared_ptr<CDRMUtils> drm = m_pWinSystem->m_DRM; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
m_nativeDisplay = m_gbm.dev; | ||
if (!m_GBM->CreateDevice(m_DRM->m_fd)) | ||
{ | ||
m_GBM.reset(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/gbm/WinSystemGbm.cpp
Outdated
@@ -65,27 +80,29 @@ bool CWinSystemGbm::CreateNewWindow(const std::string& name, | |||
bool fullScreen, | |||
RESOLUTION_INFO& res) | |||
{ | |||
if(!CDRMUtils::SetMode(res)) | |||
|
|||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/gbm/WinSystemGbm.cpp
Outdated
return m_DRM.SetVideoMode(res); | ||
struct gbm_bo *bo = m_GBM->LockFrontBuffer(); | ||
|
||
if(!m_DRM->SetVideoMode(res, bo)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
some streamlining and moving away from static functions.
@Kwiboo for review
@a1rwulf you can also have a look over please as you asked about this before :)
I also have the atomic work done. I'd like to get this in and then get atomic in.