From e4bf44b3b558742fb7c58b4d34e206c8942f07e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Mon, 2 Feb 2015 19:13:57 +0200 Subject: [PATCH] drm/modes: Print the mode status in human readable form MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently when a mode is rejected the reason is printed as a raw number. Having to manually decode that to a enum drm_mode_status value is tiresome. Have the code do the decoding instead and print the result in a human readable format. Just having an array of strings indexed with the mode status doesn't work since the enum includes negative values. So we offset the status by +3 which makes all the indexes non-negative. Also add a bit of paranoia into the code to catch out of bounds accesses in case someone adds more enum values but forgets to update the code. Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie --- Reading git-format-patch failed