Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329373
b: refs/heads/master
c: cd004b3
h: refs/heads/master
i:
  329371: 36dcf50
v: v3
  • Loading branch information
Shirish S authored and Dave Airlie committed Sep 13, 2012
1 parent 770f1e3 commit ad6c143
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93eb58d53fb14e9eeb1b42f8c04dbd7afc09adf7
refs/heads/master: cd004b3f4cd4169815c82bf9e424fda06978898a
19 changes: 16 additions & 3 deletions trunk/drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
int block, int len)
{
unsigned char start = block * EDID_LENGTH;
unsigned char segment = block >> 1;
unsigned char xfers = segment ? 3 : 2;
int ret, retries = 5;

/* The core i2c driver will automatically retry the transfer if the
Expand All @@ -265,6 +267,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
do {
struct i2c_msg msgs[] = {
{
.addr = DDC_SEGMENT_ADDR,
.flags = 0,
.len = 1,
.buf = &segment,
}, {
.addr = DDC_ADDR,
.flags = 0,
.len = 1,
Expand All @@ -276,15 +283,21 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
.buf = buf,
}
};
ret = i2c_transfer(adapter, msgs, 2);

/*
* Avoid sending the segment addr to not upset non-compliant ddc
* monitors.
*/
ret = i2c_transfer(adapter, &msgs[3 - xfers], xfers);

if (ret == -ENXIO) {
DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n",
adapter->name);
break;
}
} while (ret != 2 && --retries);
} while (ret != xfers && --retries);

return ret == 2 ? 0 : -1;
return ret == xfers ? 0 : -1;
}

static bool drm_edid_is_zero(u8 *in_edid, int length)
Expand Down

0 comments on commit ad6c143

Please sign in to comment.