Commit dbffdff7 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/ltc: serialise cbc operations with private mutex

nvkm_subdev.mutex is going away.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent e5bf9a5c
...@@ -13,6 +13,7 @@ struct nvkm_ltc { ...@@ -13,6 +13,7 @@ struct nvkm_ltc {
u32 ltc_nr; u32 ltc_nr;
u32 lts_nr; u32 lts_nr;
struct mutex mutex; /* serialises CBC operations */
u32 num_tags; u32 num_tags;
u32 tag_base; u32 tag_base;
struct nvkm_memory *tag_ram; struct nvkm_memory *tag_ram;
......
...@@ -33,10 +33,10 @@ nvkm_ltc_tags_clear(struct nvkm_device *device, u32 first, u32 count) ...@@ -33,10 +33,10 @@ nvkm_ltc_tags_clear(struct nvkm_device *device, u32 first, u32 count)
BUG_ON((first > limit) || (limit >= ltc->num_tags)); BUG_ON((first > limit) || (limit >= ltc->num_tags));
mutex_lock(&ltc->subdev.mutex); mutex_lock(&ltc->mutex);
ltc->func->cbc_clear(ltc, first, limit); ltc->func->cbc_clear(ltc, first, limit);
ltc->func->cbc_wait(ltc); ltc->func->cbc_wait(ltc);
mutex_unlock(&ltc->subdev.mutex); mutex_unlock(&ltc->mutex);
} }
int int
...@@ -113,6 +113,7 @@ nvkm_ltc_dtor(struct nvkm_subdev *subdev) ...@@ -113,6 +113,7 @@ nvkm_ltc_dtor(struct nvkm_subdev *subdev)
{ {
struct nvkm_ltc *ltc = nvkm_ltc(subdev); struct nvkm_ltc *ltc = nvkm_ltc(subdev);
nvkm_memory_unref(&ltc->tag_ram); nvkm_memory_unref(&ltc->tag_ram);
mutex_destroy(&ltc->mutex);
return ltc; return ltc;
} }
...@@ -135,6 +136,7 @@ nvkm_ltc_new_(const struct nvkm_ltc_func *func, struct nvkm_device *device, ...@@ -135,6 +136,7 @@ nvkm_ltc_new_(const struct nvkm_ltc_func *func, struct nvkm_device *device,
nvkm_subdev_ctor(&nvkm_ltc, device, index, &ltc->subdev); nvkm_subdev_ctor(&nvkm_ltc, device, index, &ltc->subdev);
ltc->func = func; ltc->func = func;
mutex_init(&ltc->mutex);
ltc->zbc_min = 1; /* reserve 0 for disabled */ ltc->zbc_min = 1; /* reserve 0 for disabled */
ltc->zbc_max = min(func->zbc, NVKM_LTC_MAX_ZBC_CNT) - 1; ltc->zbc_max = min(func->zbc, NVKM_LTC_MAX_ZBC_CNT) - 1;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment