blob: 70e0ffc55d6a10deaecc475ef995d9d4e8e1b0f6 [file] [log] [blame]
Joel Stanley3e323ab2015-09-11 14:48:21 +10001From f830d515678686ba2975dca0eac47dbae77a63b3 Mon Sep 17 00:00:00 2001
2From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
3Date: Fri, 31 Oct 2014 15:06:38 +1100
4Subject: [PATCH 5/9] drm/ast: Default to 8bpp on big endian
5
6This chip is LE only (some versions support HW swappers but not
7the latest and the driver doesn't anyway).
8
9I tried using the "foreign endian" fb flag but it appears to be
10busted, so instead, default to endian-neutral 8bpp for BE.
11
12Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13Signed-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
18diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
19index 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--
442.5.0
45