From: Dave Airlie Date: Thu, 11 Dec 2014 00:12:57 +0000 (+1000) Subject: Merge tag 'topic/core-stuff-2014-12-10' of git://anongit.freedesktop.org/drm-intel... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=da9df2f41057d71102668f5ac6b3fc998118a59b;p=linux-beck.git Merge tag 'topic/core-stuff-2014-12-10' of git://anongit.freedesktop.org/drm-intel into drm-next Merge drm core fixes from Daniel. * tag 'topic/core-stuff-2014-12-10' of git://anongit.freedesktop.org/drm-intel: drm: Zero out DRM object memory upon cleanup drm: fix a typo in a comment drm: fix a word repetition in a comment drm: Fix memory leak at error path of drm_read() drm/Documentation: Fix rowspan value in drm-kms-properties drm/edid: Restore kerneldoc consistency drm/edid: new drm_edid_block_checksum helper function V3 drm/edid: shorten log output in case of all zeroes edid block drm/edid: move drm_edid_is_zero to top, make edid argument const --- da9df2f41057d71102668f5ac6b3fc998118a59b diff --cc Documentation/DocBook/drm.tmpl index 60c1063d4178,b344bc3b0d77..7a44d9d43c49 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl @@@ -2550,8 -2546,8 +2550,8 @@@ void intel_crt_init(struct drm_device * Description/Restrictions - DRM - DRM - Generic ++ DRM + Generic “EDID” BLOB | IMMUTABLE 0 diff --cc drivers/gpu/drm/drm_edid.c index 72fd8820e186,21cc45cf3367..53bc7a628909 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@@ -1015,8 -1014,24 +1015,27 @@@ module_param_named(edid_fixup, edid_fix MODULE_PARM_DESC(edid_fixup, "Minimum number of valid EDID header bytes (0-8, default 6)"); +static void drm_get_displayid(struct drm_connector *connector, + struct edid *edid); ++ + static int drm_edid_block_checksum(const u8 *raw_edid) + { + int i; + u8 csum = 0; + for (i = 0; i < EDID_LENGTH; i++) + csum += raw_edid[i]; + + return csum; + } + + static bool drm_edid_is_zero(const u8 *in_edid, int length) + { + if (memchr_inv(in_edid, 0, length)) + return false; + + return true; + } + /** * drm_edid_block_valid - Sanity check the EDID block (base or extension) * @raw_edid: pointer to raw EDID block @@@ -1179,34 -1196,8 +1200,26 @@@ drm_do_probe_ddc_edid(void *data, u8 *b return ret == xfers ? 0 : -1; } - static bool drm_edid_is_zero(u8 *in_edid, int length) - { - if (memchr_inv(in_edid, 0, length)) - return false; - - return true; - } - -static u8 * -drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) +/** + * drm_do_get_edid - get EDID data using a custom EDID block read function + * @connector: connector we're probing + * @get_edid_block: EDID block read function + * @data: private data passed to the block read function + * + * When the I2C adapter connected to the DDC bus is hidden behind a device that + * exposes a different interface to read EDID blocks this function can be used + * to get EDID data using a custom block read function. + * + * As in the general case the DDC bus is accessible by the kernel at the I2C + * level, drivers must make all reasonable efforts to expose it as an I2C + * adapter and use drm_get_edid() instead of abusing this function. + * + * Return: Pointer to valid EDID or NULL if we couldn't find any. + */ +struct edid *drm_do_get_edid(struct drm_connector *connector, + int (*get_edid_block)(void *data, u8 *buf, unsigned int block, + size_t len), + void *data) { int i, j = 0, valid_extensions = 0; u8 *block, *new;