drm: plane_formats -> primary_formats

This commit is contained in:
Simon Ser 2021-07-28 19:26:31 +02:00
parent 94706f0f0e
commit a7ab8e7a1a
3 changed files with 12 additions and 12 deletions

View file

@ -167,16 +167,6 @@ static struct plane *find_primary_plane(struct drm_t *drm)
if (primary == nullptr)
return nullptr;
if (!get_plane_formats(drm, primary, &drm->plane_formats)) {
return nullptr;
}
g_nDRMFormat = pick_plane_format(&drm->plane_formats);
if ( g_nDRMFormat == DRM_FORMAT_INVALID ) {
fprintf( stderr, "Primary plane doesn't support XRGB8888 nor ARGB8888\n" );
return nullptr;
}
return primary;
}
@ -548,6 +538,16 @@ int init_drm(struct drm_t *drm, const char *device_name)
return -1;
}
if (!get_plane_formats(drm, drm->plane, &drm->primary_formats)) {
return -1;
}
g_nDRMFormat = pick_plane_format(&drm->primary_formats);
if ( g_nDRMFormat == DRM_FORMAT_INVALID ) {
fprintf( stderr, "Primary plane doesn't support XRGB8888 nor ARGB8888\n" );
return -1;
}
drm->kms_in_fence_fd = -1;
std::thread flip_handler_thread( flip_handler_thread_run );

View file

@ -79,7 +79,7 @@ struct drm_t {
int kms_in_fence_fd;
int kms_out_fence_fd;
struct wlr_drm_format_set plane_formats;
struct wlr_drm_format_set primary_formats;
drmModeAtomicReq *req;
uint32_t flags;

View file

@ -381,7 +381,7 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, VkFormat format, cr
}
else
{
const struct wlr_drm_format *drmFormatDesc = wlr_drm_format_set_get( &g_DRM.plane_formats, drmFormat );
const struct wlr_drm_format *drmFormatDesc = wlr_drm_format_set_get( &g_DRM.primary_formats, drmFormat );
assert( drmFormatDesc != nullptr );
possibleModifiers = drmFormatDesc->modifiers;
numPossibleModifiers = drmFormatDesc->len;