Skip to content

Commit

Permalink
Revert "drm/i915: Don't save/restore hardware status page address reg…
Browse files Browse the repository at this point in the history
…ister"

This reverts commit a7a75c8.

There are two different variations on how Intel hardware addresses the
"Hardware Status Page". One as a location in physical memory and the
other as an offset into the virtual memory of the GPU, used in more
recent chipsets. (The HWS itself is a cacheable region of memory which
the GPU can write to without requiring CPU synchronisation, used for
updating various details of hardware state, such as the position of
the GPU head in the ringbuffer, the last breadcrumb seqno, etc).

These two types of addresses were updated in different locations of code
- one inline with the ringbuffer initialisation, and the other during
device initialisation. (The HWS page is logically associated with
the rings, and there is one HWS page per ring.) During resume, only the
ringbuffers were being re-initialised along with the virtual HWS page,
leaving the older physical address HWS untouched. This then caused a
hang on the older gen3/4 (915GM, 945GM, 965GM) the first time we tried
to synchronise the GPU as the breadcrumbs were never being updated.

Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Jan Niehusmann <jan@gondor.com>
Reported-and-tested-by: Justin P. Mattock <justinmattock@gmail.com>
Reported-and-tested-by: Michael "brot" Groh <brot@minad.de>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>
  • Loading branch information
Chris Wilson committed Mar 24, 2011
1 parent f6e4788 commit f0c8602
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ typedef struct drm_i915_private {
u32 saveDSPACNTR;
u32 saveDSPBCNTR;
u32 saveDSPARB;
u32 saveHWS;
u32 savePIPEACONF;
u32 savePIPEBCONF;
u32 savePIPEASRC;
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/i915/i915_suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,9 @@ int i915_save_state(struct drm_device *dev)

pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);

/* Hardware status page */
dev_priv->saveHWS = I915_READ(HWS_PGA);

i915_save_display(dev);

/* Interrupt state */
Expand Down Expand Up @@ -842,6 +845,9 @@ int i915_restore_state(struct drm_device *dev)

pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);

/* Hardware status page */
I915_WRITE(HWS_PGA, dev_priv->saveHWS);

i915_restore_display(dev);

/* Interrupt state */
Expand Down

0 comments on commit f0c8602

Please sign in to comment.