drm/i915: Print pretty names for pixel formats
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 7 Jun 2013 15:43:05 +0000 (15:43 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 10 Jun 2013 22:13:55 +0000 (08:13 +1000)
Use drm_get_format_name to print more readable pixel format names
in debug output.

Also unify the debug messages to say "unsupported pixel format",
which better describes what is going on.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/i915/intel_display.c

index e81eb20e2c88eb27d62074d6023edfcbe8ded117..a4c9f56afb38c32958b0bce61eb2b260880e5af6 100644 (file)
@@ -8945,7 +8945,8 @@ int intel_framebuffer_init(struct drm_device *dev,
        case DRM_FORMAT_XRGB1555:
        case DRM_FORMAT_ARGB1555:
                if (INTEL_INFO(dev)->gen > 3) {
-                       DRM_DEBUG("invalid format: 0x%08x\n", mode_cmd->pixel_format);
+                       DRM_DEBUG("unsupported pixel format: %s\n",
+                                 drm_get_format_name(mode_cmd->pixel_format));
                        return -EINVAL;
                }
                break;
@@ -8956,7 +8957,8 @@ int intel_framebuffer_init(struct drm_device *dev,
        case DRM_FORMAT_XBGR2101010:
        case DRM_FORMAT_ABGR2101010:
                if (INTEL_INFO(dev)->gen < 4) {
-                       DRM_DEBUG("invalid format: 0x%08x\n", mode_cmd->pixel_format);
+                       DRM_DEBUG("unsupported pixel format: %s\n",
+                                 drm_get_format_name(mode_cmd->pixel_format));
                        return -EINVAL;
                }
                break;
@@ -8965,12 +8967,14 @@ int intel_framebuffer_init(struct drm_device *dev,
        case DRM_FORMAT_YVYU:
        case DRM_FORMAT_VYUY:
                if (INTEL_INFO(dev)->gen < 5) {
-                       DRM_DEBUG("invalid format: 0x%08x\n", mode_cmd->pixel_format);
+                       DRM_DEBUG("unsupported pixel format: %s\n",
+                                 drm_get_format_name(mode_cmd->pixel_format));
                        return -EINVAL;
                }
                break;
        default:
-               DRM_DEBUG("unsupported pixel format 0x%08x\n", mode_cmd->pixel_format);
+               DRM_DEBUG("unsupported pixel format: %s\n",
+                         drm_get_format_name(mode_cmd->pixel_format));
                return -EINVAL;
        }