dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 17/33] drm/omap: remove support for ext mem & sync
Date: Wed, 24 Feb 2016 00:42:16 +0200	[thread overview]
Message-ID: <8183579.U7ycMG47Y1@avalon> (raw)
In-Reply-To: <1455875288-4370-18-git-send-email-tomi.valkeinen@ti.com>

Hi Tomi,

Thank you for the patch.

On Friday 19 February 2016 11:47:52 Tomi Valkeinen wrote:
> We no longer have the omapdrm plugin system for SGX, and we can thus
> remove the support for external memory and sync objects from omap_gem.c.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_gem.c | 91 ++++++-----------------------------
>  1 file changed, 16 insertions(+), 75 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c
> b/drivers/gpu/drm/omapdrm/omap_gem.c index db5dbdb8cd0a..52e4a6c95058
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_gem.c
> +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
> @@ -33,9 +33,7 @@
>  /* note: we use upper 8 bits of flags for driver-internal flags: */
>  #define OMAP_BO_MEM_DMA_API	0x01000000	/* memory allocated with the
>  dma_alloc_* API */
>  #define OMAP_BO_MEM_SHMEM	0x02000000	/* memory allocated through
>  shmem backing */
> -#define OMAP_BO_MEM_EXT		0x04000000	/* memory allocated externally */
>  #define OMAP_BO_MEM_DMABUF	0x08000000	/* memory imported from a dmabuf
> */
> -#define OMAP_BO_EXT_SYNC	0x10000000	/* externally allocated sync object
> */
> 
>  struct omap_gem_object {
>  	struct drm_gem_object base;
> @@ -1177,20 +1175,6 @@ unlock:
>  	return ret;
>  }
> 
> -/* it is a bit lame to handle updates in this sort of polling way, but
> - * in case of PVR, the GPU can directly update read/write complete
> - * values, and not really tell us which ones it updated.. this also
> - * means that sync_lock is not quite sufficient.  So we'll need to
> - * do something a bit better when it comes time to add support for
> - * separate 2d hw..
> - */
> -void omap_gem_op_update(void)

The function is still referenced from a comment above omap_gem_op_async().

> -{
> -	spin_lock(&sync_lock);
> -	sync_op_update();
> -	spin_unlock(&sync_lock);
> -}
> -
>  /* mark the start of read and/or write operation */
>  int omap_gem_op_start(struct drm_gem_object *obj, enum omap_gem_op op)
>  {
> @@ -1300,43 +1284,6 @@ int omap_gem_op_async(struct drm_gem_object *obj,
> enum omap_gem_op op, return 0;
>  }
> 
> -/* special API so PVR can update the buffer to use a sync-object allocated
> - * from it's sync-obj heap.  Only used for a newly allocated (from PVR's
> - * perspective) sync-object, so we overwrite the new syncobj w/ values
> - * from the already allocated syncobj (if there is one)
> - */
> -int omap_gem_set_sync_object(struct drm_gem_object *obj, void *syncobj)

And this one from a comment in the omap_gem_object() structure.

The rest looks good to me, after updating the comments,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> -{
> -	struct omap_gem_object *omap_obj = to_omap_bo(obj);
> -	int ret = 0;
> -
> -	spin_lock(&sync_lock);
> -
> -	if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) {
> -		/* clearing a previously set syncobj */
> -		syncobj = kmemdup(omap_obj->sync, sizeof(*omap_obj->sync),
> -				  GFP_ATOMIC);
> -		if (!syncobj) {
> -			ret = -ENOMEM;
> -			goto unlock;
> -		}
> -		omap_obj->flags &= ~OMAP_BO_EXT_SYNC;
> -		omap_obj->sync = syncobj;
> -	} else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) {
> -		/* replacing an existing syncobj */
> -		if (omap_obj->sync) {
> -			memcpy(syncobj, omap_obj->sync, sizeof(*omap_obj->sync));
> -			kfree(omap_obj->sync);
> -		}
> -		omap_obj->flags |= OMAP_BO_EXT_SYNC;
> -		omap_obj->sync = syncobj;
> -	}
> -
> -unlock:
> -	spin_unlock(&sync_lock);
> -	return ret;
> -}
> -
>  /*
> ---------------------------------------------------------------------------
> -- * Constructor & Destructor
>   */
> @@ -1360,28 +1307,23 @@ void omap_gem_free_object(struct drm_gem_object
> *obj) */
>  	WARN_ON(omap_obj->paddr_cnt > 0);
> 
> -	/* don't free externally allocated backing memory */
> -	if (!(omap_obj->flags & OMAP_BO_MEM_EXT)) {
> -		if (omap_obj->pages) {
> -			if (omap_obj->flags & OMAP_BO_MEM_DMABUF)
> -				kfree(omap_obj->pages);
> -			else
> -				omap_gem_detach_pages(obj);
> -		}
> +	if (omap_obj->pages) {
> +		if (omap_obj->flags & OMAP_BO_MEM_DMABUF)
> +			kfree(omap_obj->pages);
> +		else
> +			omap_gem_detach_pages(obj);
> +	}
> 
> -		if (omap_obj->flags & OMAP_BO_MEM_DMA_API) {
> -			dma_free_writecombine(dev->dev, obj->size,
> -					omap_obj->vaddr, omap_obj->paddr);
> -		} else if (omap_obj->vaddr) {
> -			vunmap(omap_obj->vaddr);
> -		} else if (obj->import_attach) {
> -			drm_prime_gem_destroy(obj, omap_obj->sgt);
> -		}
> +	if (omap_obj->flags & OMAP_BO_MEM_DMA_API) {
> +		dma_free_writecombine(dev->dev, obj->size,
> +				omap_obj->vaddr, omap_obj->paddr);
> +	} else if (omap_obj->vaddr) {
> +		vunmap(omap_obj->vaddr);
> +	} else if (obj->import_attach) {
> +		drm_prime_gem_destroy(obj, omap_obj->sgt);
>  	}
> 
> -	/* don't free externally allocated syncobj */
> -	if (!(omap_obj->flags & OMAP_BO_EXT_SYNC))
> -		kfree(omap_obj->sync);
> +	kfree(omap_obj->sync);
> 
>  	drm_gem_object_release(obj);
> 
> @@ -1426,10 +1368,9 @@ struct drm_gem_object *omap_gem_new(struct drm_device
> *dev, * use contiguous memory only if no TILER is available.
>  		 */
>  		flags |= OMAP_BO_MEM_DMA_API;
> -	} else if (!(flags & (OMAP_BO_MEM_EXT | OMAP_BO_MEM_DMABUF))) {
> +	} else if (!(flags & OMAP_BO_MEM_DMABUF)) {
>  		/*
> -		 * All other buffers not backed by external memory or dma_buf
> -		 * are shmem-backed.
> +		 * All other buffers not backed by dma_buf are shmem-backed.
>  		 */
>  		flags |= OMAP_BO_MEM_SHMEM;
>  	}

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-02-23 22:42 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19  9:47 [PATCH 00/33] drm/omap: patches for v4.6 Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 01/33] drm/omap: HDMI: change enable/disable to avoid sync-losts Tomi Valkeinen
2016-02-23 10:22   ` Laurent Pinchart
2016-02-23 11:33     ` Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 02/33] HACK: drm/omap: always use blocking DMM fill Tomi Valkeinen
2016-02-23 10:27   ` Laurent Pinchart
2016-02-23 13:09     ` Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 03/33] HACK: drm/omap: fix memory barrier bug in DMM driver Tomi Valkeinen
2016-02-23 21:13   ` Laurent Pinchart
2016-02-24 10:34     ` Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 04/33] drm/omap: add dmm_read() and dmm_write() wrappers Tomi Valkeinen
2016-02-23 21:18   ` Laurent Pinchart
2016-02-19  9:47 ` [PATCH 05/33] drm/omap: partial workaround for DRA7 DMM errata i878 Tomi Valkeinen
2016-02-23 21:57   ` Laurent Pinchart
2016-02-24  9:14     ` Tomi Valkeinen
2017-09-29 12:29     ` Peter Ujfalusi
2016-02-19  9:47 ` [PATCH 06/33] drm/omap: drm_atomic_get_plane_state() may return ERR_PTR Tomi Valkeinen
2016-02-23 22:01   ` Laurent Pinchart
2016-02-19  9:47 ` [PATCH 07/33] drm/omap: tpd12s015: remove platform data support Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 08/33] drm/omap: tpd12s015: gpio descriptor API Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 09/33] drm/omap: tpd12s015: CT_CP_HPD as optional gpio Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 10/33] drm/omap: add define for DISPC_IRQ_WBUNCOMPLETEERROR Tomi Valkeinen
2016-02-23 22:04   ` Laurent Pinchart
2016-02-19  9:47 ` [PATCH 11/33] drm/omap: use dma_mapping_error in omap_gem_attach_pages Tomi Valkeinen
2016-02-23 22:10   ` Laurent Pinchart
2016-02-25 15:39     ` Tomi Valkeinen
2016-02-26  8:52       ` Laurent Pinchart
2016-02-26  9:07         ` Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 12/33] drm/omap: use dma_mapping_error in omap_gem_dma_sync Tomi Valkeinen
2016-02-23 22:14   ` Laurent Pinchart
2016-02-25 15:45     ` Tomi Valkeinen
2016-02-26  8:54       ` Laurent Pinchart
2016-02-19  9:47 ` [PATCH 13/33] drm/omap: print an error if display enable fails Tomi Valkeinen
2016-02-23 22:17   ` Laurent Pinchart
2016-02-19  9:47 ` [PATCH 14/33] drm/omap: gem: Clean up GEM objects memory flags Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 15/33] drm/omap: gem: Refactor GEM object allocation Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 16/33] drm/omap: gem: Implement dma_buf import Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 17/33] drm/omap: remove support for ext mem & sync Tomi Valkeinen
2016-02-23 22:42   ` Laurent Pinchart [this message]
2016-02-24  9:38     ` Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 18/33] drm/omap: increase vblank wait timeout Tomi Valkeinen
2016-02-23 22:43   ` Laurent Pinchart
2016-02-24  9:41     ` Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 19/33] drm/omap: DISPC: support double-pixel mode Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 20/33] drm/omap: support double-pixel Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 21/33] drm/omap: HDMI: support double-pixel pixel clock Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 22/33] drm/omap: HDMI: Fix HSW value Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 23/33] drm/omap: HDMI: fix WP timings for ilace Tomi Valkeinen
2016-02-19  9:47 ` [PATCH 24/33] drm/omap: DISPC: Fix field order for HDMI Tomi Valkeinen
2016-02-19  9:48 ` [PATCH 25/33] drm/omap: HDMI5: Fix FC HSW value Tomi Valkeinen
2016-02-19  9:48 ` [PATCH 26/33] drm/omap: HDMI5: clean up timings copy Tomi Valkeinen
2016-02-19  9:48 ` [PATCH 27/33] drm/omap: HDMI5: Add interlace support Tomi Valkeinen
2016-02-19  9:48 ` [PATCH 28/33] drm/omap: HDMI5: allow interlace Tomi Valkeinen
2016-02-19  9:48 ` [PATCH 29/33] drm/omap: verify that display x-res is divisible by 8 Tomi Valkeinen
2016-02-19  9:48 ` [PATCH 30/33] drm/omap: verify that fb plane pitches are the same Tomi Valkeinen
2016-02-23 23:02   ` Laurent Pinchart
2016-02-25 15:56     ` Tomi Valkeinen
2016-02-26  8:55       ` Laurent Pinchart
2016-02-26  9:12         ` Tomi Valkeinen
2016-02-26  9:27           ` Laurent Pinchart
2016-02-19  9:48 ` [PATCH 31/33] drm/omap: EBUSY status handling in omap_gem_fault() Tomi Valkeinen
2016-02-19  9:48 ` [PATCH 32/33] drm/omap: fix crtc->plane property delegation Tomi Valkeinen
2016-02-23 23:24   ` Laurent Pinchart
2016-02-19  9:48 ` [PATCH 33/33] drm/omap: check if rotation is supported before commit Tomi Valkeinen
2016-02-23 23:30   ` Laurent Pinchart

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=8183579.U7ycMG47Y1@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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