Skip to contentSkip to conversation

drm/cirrus: Workaround for HDR access

PATCH New Benjamin Herrenschmidt 1 participant 1 message Jul 25, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/6 drm/cirrus: Workaround for HDR access

Qemu has an odd behaviour with the access to HDR (could be a qemu bug, I'm investigating separately, but it affects current qemu's so we should try to work around it).

Basically the internal counter that counts the reads of the 3c6 register in order to give you access to the HDR on the 5th access is initialized in such a way that it overflows if you start doing the 4-reads sequence right after reset, and thus fails to pickup the subsequent write.

We work around this by doing a write before the 4 reads, which resets the counter properly.

---
 drivers/gpu/drm/cirrus/cirrus_drv.h |    1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/cirrus/cirrus_drv.h +1 -0
index 64ea597..b5685d3 100644
@@ -74,6 +74,7 @@
 
 #define WREG_HDR(v)						\
 	do {							\
+		WREG8(VGA_DAC_MASK, v);	/* reset counter */		\
 		RREG8(VGA_DAC_MASK);					\
 		RREG8(VGA_DAC_MASK);					\
 		RREG8(VGA_DAC_MASK);					\