Skip to content
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

Merged
merged 3 commits into from Dec 12, 2017
Merged

windowing/gbm: cleanup and OO structure #13136

merged 3 commits into from Dec 12, 2017

Conversation

lrusak
Copy link
Contributor

@lrusak lrusak commented Dec 5, 2017

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.

@lrusak lrusak added Platform: Linux No Jenkins do not run automatic Jenkins builds on this PR v18 Leia labels Dec 5, 2017
@lrusak lrusak added this to the L 18.0-alpha1 milestone Dec 5, 2017
protected:
CDRM m_DRM;
CDRMUtils *m_DRM;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

{
return m_drm;
return this;
}

This comment was marked as spam.

This comment was marked as spam.

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.

This comment was marked as spam.

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.

This comment was marked as spam.

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.

This comment was marked as spam.

This comment was marked as spam.

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.

This comment was marked as spam.

@@ -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.

@@ -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.

@@ -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.

@lrusak
Copy link
Contributor Author

lrusak commented Dec 11, 2017

moved CGBMUtils to OO structure as well. Please have a look @Kwiboo

@Kwiboo
Copy link
Member

Kwiboo commented Dec 11, 2017

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.

@@ -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.

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.

@@ -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.

return m_DRM.SetVideoMode(res);
struct gbm_bo *bo = m_GBM->LockFrontBuffer();

if(!m_DRM->SetVideoMode(res, bo))

This comment was marked as spam.

@lrusak lrusak merged commit e967f20 into xbmc:master Dec 12, 2017
@lrusak lrusak mentioned this pull request Dec 12, 2017
5 tasks
@lrusak lrusak deleted the drm-OO branch February 11, 2022 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Jenkins do not run automatic Jenkins builds on this PR Platform: Linux v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants