[PATCH 4/4] drm/msm: always wait for the exclusive fence
Christian König
ckoenig.leichtzumerken at gmail.com
Thu Jul 8 12:52:55 UTC 2021
Am 03.07.21 um 01:01 schrieb Daniel Vetter:
> On Fri, Jul 02, 2021 at 01:16:42PM +0200, Christian König wrote:
>> Drivers also need to to sync to the exclusive fence when
>> a shared one is present.
>>
>> Completely untested since the driver won't even compile on !ARM.
> It's really not that hard to set up a cross-compiler, reasonable distros
> have that now all packages. Does explain though why you tend to break the
> arm build with drm-misc patches.
Well having proper COMPILE_TEST handling in kconfig would be even better.
Otherwise everybody needs to cross-compile for ARM, ARM64 (with all the
variants, e.g. BCM, S3C64XX, S5PV210, KEEMBAY, ZYNQMP etc etc), MIPS and
so on.
We have tons of non-x86 drivers, but MSM is the only one which is
painful to get to compile test.
Christian.
>
> Please fix this.
>
>> Signed-off-by: Christian König <christian.koenig at amd.com>
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
>> ---
>> drivers/gpu/drm/msm/msm_gem.c | 16 +++++++---------
>> 1 file changed, 7 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
>> index a94a43de95ef..72a07e311de3 100644
>> --- a/drivers/gpu/drm/msm/msm_gem.c
>> +++ b/drivers/gpu/drm/msm/msm_gem.c
>> @@ -817,17 +817,15 @@ int msm_gem_sync_object(struct drm_gem_object *obj,
>> struct dma_fence *fence;
>> int i, ret;
>>
>> - fobj = dma_resv_shared_list(obj->resv);
>> - if (!fobj || (fobj->shared_count == 0)) {
>> - fence = dma_resv_excl_fence(obj->resv);
>> - /* don't need to wait on our own fences, since ring is fifo */
>> - if (fence && (fence->context != fctx->context)) {
>> - ret = dma_fence_wait(fence, true);
>> - if (ret)
>> - return ret;
>> - }
>> + fence = dma_resv_excl_fence(obj->resv);
>> + /* don't need to wait on our own fences, since ring is fifo */
>> + if (fence && (fence->context != fctx->context)) {
>> + ret = dma_fence_wait(fence, true);
>> + if (ret)
>> + return ret;
>> }
>>
>> + fobj = dma_resv_shared_list(obj->resv);
>> if (!exclusive || !fobj)
>> return 0;
>>
>> --
>> 2.25.1
>>
More information about the dri-devel
mailing list