Joel Stanley | 3e323ab | 2015-09-11 14:48:21 +1000 | [diff] [blame] | 1 | From f830d515678686ba2975dca0eac47dbae77a63b3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Herrenschmidt <benh@kernel.crashing.org> |
| 3 | Date: Fri, 31 Oct 2014 15:06:38 +1100 |
| 4 | Subject: [PATCH 5/9] drm/ast: Default to 8bpp on big endian |
| 5 | |
| 6 | This chip is LE only (some versions support HW swappers but not |
| 7 | the latest and the driver doesn't anyway). |
| 8 | |
| 9 | I tried using the "foreign endian" fb flag but it appears to be |
| 10 | busted, so instead, default to endian-neutral 8bpp for BE. |
| 11 | |
| 12 | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> |
| 13 | Signed-off-by: Joel Stanley <joel@jms.id.au> |
| 14 | --- |
| 15 | drivers/gpu/drm/ast/ast_fb.c | 13 +++++++++++++ |
| 16 | 1 file changed, 13 insertions(+) |
| 17 | |
| 18 | diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c |
| 19 | index ff68eef..c532c69 100644 |
| 20 | --- a/drivers/gpu/drm/ast/ast_fb.c |
| 21 | +++ b/drivers/gpu/drm/ast/ast_fb.c |
| 22 | @@ -345,7 +345,20 @@ int ast_fbdev_init(struct drm_device *dev) |
| 23 | /* disable all the possible outputs/crtcs before entering KMS mode */ |
| 24 | drm_helper_disable_unused_functions(dev); |
| 25 | |
| 26 | + /* |
| 27 | + * This chip is LE only (some versions support HW swappers but not |
| 28 | + * the latest and the driver doesn't anyway). |
| 29 | + * |
| 30 | + * I tried using the "foreign endian" fb flag but it appears to be |
| 31 | + * busted, so instead, default to endian-neutral 8bpp for BE. |
| 32 | + * |
| 33 | + * (and it's faster !) |
| 34 | + */ |
| 35 | +#if defined(__BIG_ENDIAN) |
| 36 | + ret = drm_fb_helper_initial_config(&afbdev->helper, 8); |
| 37 | +#else |
| 38 | ret = drm_fb_helper_initial_config(&afbdev->helper, 32); |
| 39 | +#endif |
| 40 | if (ret) |
| 41 | goto fini; |
| 42 | |
| 43 | -- |
| 44 | 2.5.0 |
| 45 | |