public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Simona Vetter <simona.vetter@ffwll•ch>,
	Intel Graphics <intel-gfx@lists•freedesktop.org>,
	DRI <dri-devel@lists•freedesktop.org>
Cc: Boris Brezillon <boris.brezillon@collabora•com>,
	Dmitry Osipenko <dmitry.osipenko@collabora•com>,
	Jacek Lawrynowicz <jacek.lawrynowicz@linux•intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>
Subject: linux-next: manual merge of the drm-misc-fixes tree with Linus' tree
Date: Fri, 6 Jun 2025 09:47:11 +1000	[thread overview]
Message-ID: <20250606094711.4b9909af@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3841 bytes --]

Hi all,

Today's linux-next merge of the drm-misc-fixes tree got a conflict in:

  drivers/accel/ivpu/ivpu_gem.c

between commit:

  835b14ce4ee3 ("accel/ivpu: s/drm_gem_shmem_v[un]map/drm_gem_shmem_v[un]map_locked/")

from Linus' tree and commit:

  98d3f772ca7d ("accel/ivpu: Use dma_resv_lock() instead of a custom mutex")

from the drm-misc-fixes tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/accel/ivpu/ivpu_gem.c
index e0d242d9f3e5,248bfebeaa22..000000000000
--- a/drivers/accel/ivpu/ivpu_gem.c
+++ b/drivers/accel/ivpu/ivpu_gem.c
@@@ -28,11 -28,21 +28,21 @@@ static inline void ivpu_dbg_bo(struct i
  {
  	ivpu_dbg(vdev, BO,
  		 "%6s: bo %8p vpu_addr %9llx size %8zu ctx %d has_pages %d dma_mapped %d mmu_mapped %d wc %d imported %d\n",
- 		 action, bo, bo->vpu_addr, ivpu_bo_size(bo), bo->ctx ? bo->ctx->id : 0,
+ 		 action, bo, bo->vpu_addr, ivpu_bo_size(bo), bo->ctx_id,
  		 (bool)bo->base.pages, (bool)bo->base.sgt, bo->mmu_mapped, bo->base.map_wc,
 -		 (bool)bo->base.base.import_attach);
 +		 (bool)drm_gem_is_imported(&bo->base.base));
  }
  
+ static inline int ivpu_bo_lock(struct ivpu_bo *bo)
+ {
+ 	return dma_resv_lock(bo->base.base.resv, NULL);
+ }
+ 
+ static inline void ivpu_bo_unlock(struct ivpu_bo *bo)
+ {
+ 	dma_resv_unlock(bo->base.base.resv);
+ }
+ 
  /*
   * ivpu_bo_pin() - pin the backing physical pages and map them to VPU.
   *
@@@ -122,10 -130,9 +130,9 @@@ static void ivpu_bo_unbind_locked(struc
  		bo->ctx = NULL;
  	}
  
 -	if (bo->base.base.import_attach)
 +	if (drm_gem_is_imported(&bo->base.base))
  		return;
  
- 	dma_resv_lock(bo->base.base.resv, NULL);
  	if (bo->base.sgt) {
  		dma_unmap_sgtable(vdev->drm.dev, bo->base.sgt, DMA_BIDIRECTIONAL, 0);
  		sg_free_table(bo->base.sgt);
@@@ -277,12 -285,16 +285,16 @@@ static void ivpu_gem_bo_free(struct drm
  	list_del(&bo->bo_list_node);
  	mutex_unlock(&vdev->bo_list_lock);
  
- 	drm_WARN_ON(&vdev->drm, !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
+ 	drm_WARN_ON(&vdev->drm, !drm_gem_is_imported(&bo->base.base) &&
+ 		    !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
+ 	drm_WARN_ON(&vdev->drm, ivpu_bo_size(bo) == 0);
+ 	drm_WARN_ON(&vdev->drm, bo->base.vaddr);
  
  	ivpu_bo_unbind_locked(bo);
- 	mutex_destroy(&bo->lock);
+ 	drm_WARN_ON(&vdev->drm, bo->mmu_mapped);
+ 	drm_WARN_ON(&vdev->drm, bo->ctx);
  
 -	drm_WARN_ON(obj->dev, bo->base.pages_use_count > 1);
 +	drm_WARN_ON(obj->dev, refcount_read(&bo->base.pages_use_count) > 1);
  	drm_gem_shmem_free(&bo->base);
  }
  
@@@ -361,9 -376,9 +376,9 @@@ ivpu_bo_create(struct ivpu_device *vdev
  		goto err_put;
  
  	if (flags & DRM_IVPU_BO_MAPPABLE) {
- 		dma_resv_lock(bo->base.base.resv, NULL);
+ 		ivpu_bo_lock(bo);
 -		ret = drm_gem_shmem_vmap(&bo->base, &map);
 +		ret = drm_gem_shmem_vmap_locked(&bo->base, &map);
- 		dma_resv_unlock(bo->base.base.resv);
+ 		ivpu_bo_unlock(bo);
  
  		if (ret)
  			goto err_put;
@@@ -386,9 -401,9 +401,9 @@@ void ivpu_bo_free(struct ivpu_bo *bo
  	struct iosys_map map = IOSYS_MAP_INIT_VADDR(bo->base.vaddr);
  
  	if (bo->flags & DRM_IVPU_BO_MAPPABLE) {
- 		dma_resv_lock(bo->base.base.resv, NULL);
+ 		ivpu_bo_lock(bo);
 -		drm_gem_shmem_vunmap(&bo->base, &map);
 +		drm_gem_shmem_vunmap_locked(&bo->base, &map);
- 		dma_resv_unlock(bo->base.base.resv);
+ 		ivpu_bo_unlock(bo);
  	}
  
  	drm_gem_object_put(&bo->base.base);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2025-06-05 23:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05 23:47 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-20 22:16 linux-next: manual merge of the drm-misc-fixes tree with Linus' tree Stephen Rothwell
2022-12-13 22:00 Stephen Rothwell
2021-09-19 23:07 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250606094711.4b9909af@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=boris.brezillon@collabora$(echo .)com \
    --cc=dmitry.osipenko@collabora$(echo .)com \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=intel-gfx@lists$(echo .)freedesktop.org \
    --cc=jacek.lawrynowicz@linux$(echo .)intel.com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=simona.vetter@ffwll$(echo .)ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox