Merge pull request #12187 from davidgfnet/OGA-vertical

Upstream OGA patch for vertical screen
This commit is contained in:
Autechre 2021-03-23 20:55:23 +01:00 committed by GitHub
commit 605a96a096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -1372,11 +1372,10 @@ OBJ += gfx/drivers_context/gfx_null_ctx.o
ifeq ($(HAVE_KMS), 1)
HAVE_AND_WILL_USE_DRM = 1
OBJ += gfx/drivers_context/drm_ctx.o
ifeq ($(HAVE_ODROIDGO2), 1)
OBJ += gfx/drivers_context/drm_go2_ctx.o
else
OBJ += gfx/drivers_context/drm_ctx.o
endif
DEF_FLAGS += $(GBM_CFLAGS) $(DRM_CFLAGS)
LIBS += $(GBM_LIBS) $(DRM_LIBS)

View File

@ -119,12 +119,22 @@ static void *gfx_ctx_go2_drm_init(void *video_driver)
return NULL;
drm->display = go2_display_create();
drm->presenter = go2_presenter_create(drm->display,
DRM_FORMAT_RGB565, 0xff000000, true);
drm->native_width = go2_display_height_get(drm->display);
drm->native_height = go2_display_width_get(drm->display);
/* This driver should only be used on rotated screens */
if (drm->native_width < drm->native_height)
{
/* This should be fixed by using wayland/weston... */
go2_display_destroy(drm->display);
free(drm);
return NULL;
}
drm->presenter = go2_presenter_create(drm->display,
DRM_FORMAT_RGB565, 0xff000000, true);
return drm;
}

View File

@ -795,9 +795,8 @@ static const gfx_ctx_driver_t *gfx_ctx_gl_drivers[] = {
#if defined(HAVE_KMS)
#if defined(HAVE_ODROIDGO2)
&gfx_ctx_go2_drm,
#else
&gfx_ctx_drm,
#endif
&gfx_ctx_drm,
#endif
#if defined(ANDROID)
&gfx_ctx_android,