From: Kyle McMartin <k...@redhat.com>

Currently, DRM only accidently builds on powerpc/sparc64/etc, because
the #ifdef in drm_edid.h was using BIG_ENDIAN instead of __BIG_ENDIAN.

Since there's currently no driver which can use this on powerpc at the
moment (radeon modesetting is not upstream yet...) instead of failing to
build the entire DRM because of it, just bail out in the individual
EDID functions.

Signed-off-by: Kyle McMartin <k...@redhat.com>

---
I'll try update the drm_edid.h header to properly handle big endian, but
since I'm lacking a powerpc box at the moment, and I can't currently
test the DRM on parisc, someone else will have to test it for me. :)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index a839a28..3357394 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -551,6 +551,7 @@ static int add_detailed_info(struct drm_connector 
*connector,
 
 #define DDC_ADDR 0x50
 
+#ifdef __LITTLE_ENDIAN
 unsigned char *drm_do_probe_ddc_edid(struct i2c_adapter *adapter)
 {
        unsigned char start = 0x0;
@@ -582,6 +583,13 @@ unsigned char *drm_do_probe_ddc_edid(struct i2c_adapter 
*adapter)
        kfree(buf);
        return NULL;
 }
+#else
+unsigned char *drm_do_probe_ddc_edid(struct i2c_adapter *adapter)
+{
+       dev_info(&adapter->dev, "EDID unsupported on big endian.\n");
+       return NULL;
+}
+#endif /*__BIG_ENDIAN*/
 EXPORT_SYMBOL(drm_do_probe_ddc_edid);
 
 static unsigned char *drm_ddc_read(struct i2c_adapter *adapter)
@@ -653,6 +661,7 @@ static unsigned char *drm_ddc_read(struct i2c_adapter 
*adapter)
  *
  * Return edid data or NULL if we couldn't find any.
  */
+#ifdef __LITTLE_ENDIAN
 struct edid *drm_get_edid(struct drm_connector *connector,
                          struct i2c_adapter *adapter)
 {
@@ -675,6 +684,15 @@ struct edid *drm_get_edid(struct drm_connector *connector,
 
        return edid;
 }
+#else
+struct edid *drm_get_edid(struct drm_connector *connector,
+                         struct i2c_adapter *adapter)
+{
+       dev_warn(&connector->dev->pdev->dev, "%s: EDID unsupported on big 
endian.\n",
+               drm_get_connector_name(connector));
+       return NULL;
+}
+#endif /*__BIG_ENDIAN*/
 EXPORT_SYMBOL(drm_get_edid);
 
 /**
@@ -686,6 +704,7 @@ EXPORT_SYMBOL(drm_get_edid);
  *
  * Return number of modes added or 0 if we couldn't find any.
  */
+#ifdef __LITTLE_ENDIAN
 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 {
        int num_modes = 0;
@@ -729,4 +748,12 @@ int drm_add_edid_modes(struct drm_connector *connector, 
struct edid *edid)
 
        return num_modes;
 }
+#else
+int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
+{
+       dev_warn(&connector->dev->pdev->dev, "%s: EDID unsupported on big 
endian.\n",
+                drm_get_connector_name(connector));
+       return 0;
+}
+#endif /*__BIG_ENDIAN*/
 EXPORT_SYMBOL(drm_add_edid_modes);
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index ff8d27a..244133b 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -28,10 +28,6 @@
 #define EDID_LENGTH 128
 #define DDC_ADDR 0x50
 
-#ifdef BIG_ENDIAN
-#error "EDID structure is little endian, need big endian versions"
-#else
-
 struct est_timings {
        u8 t1;
        u8 t2;

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to