]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/drm_framebuffer.c
Merge tag 'm68knommu-for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / gpu / drm / drm_framebuffer.c
index df656366a530208bd26a5f15738e09a762f9a4de..2f5b0c2bb0fe3ff885becc9c6b2cca2e34a255b6 100644 (file)
@@ -176,8 +176,7 @@ static int framebuffer_check(struct drm_device *dev,
        int i;
 
        /* check if the format is supported at all */
-       info = __drm_format_info(r->pixel_format);
-       if (!info) {
+       if (!__drm_format_info(r->pixel_format)) {
                struct drm_format_name_buf format_name;
 
                DRM_DEBUG_KMS("bad framebuffer format %s\n",
@@ -186,9 +185,6 @@ static int framebuffer_check(struct drm_device *dev,
                return -EINVAL;
        }
 
-       /* now let the driver pick its own format info */
-       info = drm_get_format_info(dev, r);
-
        if (r->width == 0) {
                DRM_DEBUG_KMS("bad framebuffer width %u\n", r->width);
                return -EINVAL;
@@ -199,6 +195,9 @@ static int framebuffer_check(struct drm_device *dev,
                return -EINVAL;
        }
 
+       /* now let the driver pick its own format info */
+       info = drm_get_format_info(dev, r);
+
        for (i = 0; i < info->num_planes; i++) {
                unsigned int width = fb_plane_width(r->width, info, i);
                unsigned int height = fb_plane_height(r->height, info, i);
This page took 0.033409 seconds and 4 git commands to generate.