Commit 95e3ca33 authored by Derek Foreman's avatar Derek Foreman Committed by Lucas Stach
Browse files

drm/etnaviv: Read some FE registers twice



On some hardware (such at the GC7000 rev 6009), these registers need to be
read twice to return the correct value. Hide that in gpu_read().

Signed-off-by: default avatarDerek Foreman <derek.foreman@collabora.com>
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent e843e87a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include "etnaviv_mmu.h"
#include "etnaviv_drv.h"
#include "common.xml.h"
#include "state.xml.h"

struct etnaviv_gem_submit;
struct etnaviv_vram_mapping;
@@ -170,6 +171,13 @@ static inline void gpu_write(struct etnaviv_gpu *gpu, u32 reg, u32 data)

static inline u32 gpu_read(struct etnaviv_gpu *gpu, u32 reg)
{
	/* On some variants, such as the GC7000r6009, some FE registers
	 * need two reads to be consistent. Do that extra read here and
	 * throw away the result.
	 */
	if (reg >= VIVS_FE_DMA_STATUS && reg <= VIVS_FE_AUTO_FLUSH)
		readl(gpu->mmio + reg);

	return readl(gpu->mmio + reg);
}