summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/atom.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-11-11 09:16:15 +1000
committerAlex Deucher <alexander.deucher@amd.com>2014-11-11 17:22:26 -0500
commit1c9498425453bb65ef339a57705c5ef59fe1541d (patch)
tree293c1d2d23aa2269a67d13d8a5486cc3c6ccf549 /drivers/gpu/drm/radeon/atom.h
parent03dca708521d30153fc5c7e2ff136f780a7372c9 (diff)
drm/radeon: add locking around atombios scratch space usage
While developing MST support I noticed I often got the wrong data back from a transaction, in a racy fashion. I noticed the scratch space wasn't locked against concurrent users. Based on a patch by Alex, but I've made it a bit more obvious when things are locked. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/radeon/atom.h')
-rw-r--r--drivers/gpu/drm/radeon/atom.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h
index feba6b8d36b3..6d014ddb6b78 100644
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -125,6 +125,7 @@ struct card_info {
struct atom_context {
struct card_info *card;
struct mutex mutex;
+ struct mutex scratch_mutex;
void *bios;
uint32_t cmd_table, data_table;
uint16_t *iio;
@@ -145,6 +146,7 @@ extern int atom_debug;
struct atom_context *atom_parse(struct card_info *, void *);
int atom_execute_table(struct atom_context *, int, uint32_t *);
+int atom_execute_table_scratch_unlocked(struct atom_context *, int, uint32_t *);
int atom_asic_init(struct atom_context *);
void atom_destroy(struct atom_context *);
bool atom_parse_data_header(struct atom_context *ctx, int index, uint16_t *size,