From: Francisco Jerez Date: Mon, 30 Aug 2010 13:37:57 +0000 (+0200) Subject: drm/nv17-nv4x: Fix analog load detection false positive on rare occasions. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7314dec95c054258d5e5a3d1d55e1fd042f8eaad;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm/nv17-nv4x: Fix analog load detection false positive on rare occasions. On some boards the residual current DAC outputs can draw when they're disconnected can be high enough to give a false load detection positive (I've only seen it in the S-video luma output of some cards, but just to be sure). The output line capacitance is limited and sampling twice should fix it reliably. Signed-off-by: Francisco Jerez Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nv04_dac.c b/drivers/gpu/drm/nouveau/nv04_dac.c index ea3627041ecf..509c05015d50 100644 --- a/drivers/gpu/drm/nouveau/nv04_dac.c +++ b/drivers/gpu/drm/nouveau/nv04_dac.c @@ -291,6 +291,8 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) msleep(5); sample = NVReadRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + regoffset); + /* do it again just in case it's a residual current */ + sample &= NVReadRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + regoffset); temp = NVReadRAMDAC(dev, head, NV_PRAMDAC_TEST_CONTROL); NVWriteRAMDAC(dev, head, NV_PRAMDAC_TEST_CONTROL,