dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Allow range of 0 for drm_mm_insert_node_in_range()
Date: Wed, 26 Jun 2019 23:28:17 +0200	[thread overview]
Message-ID: <20190626212817.GZ12905@phenom.ffwll.local> (raw)
In-Reply-To: <20190626094330.3556-1-chris@chris-wilson.co.uk>

On Wed, Jun 26, 2019 at 10:43:30AM +0100, Chris Wilson wrote:
> We gracefully handle the caller specifying a zero range, so don't force
> them to special case that condition if it naturally falls out of their
> setup. What we don't check is if the end < start, so keep that as an
> assert for an illegal call.

Maybe spend a few words on why a drm_mm user might want to do that. Sounds
very funky ...
-Daniel

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_mm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
> index 9a59865ce574..4581c5387372 100644
> --- a/drivers/gpu/drm/drm_mm.c
> +++ b/drivers/gpu/drm/drm_mm.c
> @@ -472,7 +472,7 @@ int drm_mm_insert_node_in_range(struct drm_mm * const mm,
>  	u64 remainder_mask;
>  	bool once;
>  
> -	DRM_MM_BUG_ON(range_start >= range_end);
> +	DRM_MM_BUG_ON(range_start > range_end);
>  
>  	if (unlikely(size == 0 || range_end - range_start < size))
>  		return -ENOSPC;
> -- 
> 2.20.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2019-06-26 21:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  9:43 [PATCH] drm: Allow range of 0 for drm_mm_insert_node_in_range() Chris Wilson
2019-06-26 17:32 ` Daniele Ceraolo Spurio
2019-06-26 21:28 ` Daniel Vetter [this message]

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=20190626212817.GZ12905@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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