From: "Antoine, Peter" <peter.antoine@intel.com>
To: "daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>
Cc: "Vetter, Daniel" <daniel.vetter@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/3] drm: Convert drm_legacy_ctxbitmap_init to void return type
Date: Tue, 23 Jun 2015 13:15:07 +0000 [thread overview]
Message-ID: <1435065305.22268.2.camel@peterant-linux> (raw)
In-Reply-To: <1435052228-29710-2-git-send-email-daniel.vetter@ffwll.ch>
On Tue, 2015-06-23 at 11:37 +0200, Daniel Vetter wrote:
> It can't fail really.
>
> Also remove the redundant kms check Peter added.
>
> Cc: Peter Antoine <peter.antoine@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> drivers/gpu/drm/drm_context.c | 5 ++---
> drivers/gpu/drm/drm_drv.c | 10 +---------
> drivers/gpu/drm/drm_legacy.h | 2 +-
> 3 files changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c
> index 32958dabd7b0..192a5f9eeb74 100644
> --- a/drivers/gpu/drm/drm_context.c
> +++ b/drivers/gpu/drm/drm_context.c
> @@ -89,14 +89,13 @@ static int drm_legacy_ctxbitmap_next(struct drm_device * dev)
> *
> * Initialise the drm_device::ctx_idr
> */
> -int drm_legacy_ctxbitmap_init(struct drm_device * dev)
> +void drm_legacy_ctxbitmap_init(struct drm_device * dev)
> {
> if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
> drm_core_check_feature(dev, DRIVER_MODESET))
> - return -EINVAL;
> + return;
>
> idr_init(&dev->ctx_idr);
> - return 0;
> }
>
> /**
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index e5717116346d..ddc4943404c6 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -584,14 +584,7 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver,
> if (drm_ht_create(&dev->map_hash, 12))
> goto err_minors;
>
> - if (drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) ||
> - !drm_core_check_feature(dev, DRIVER_MODESET))
> - ret = drm_legacy_ctxbitmap_init(dev);
> - if (ret) {
> - DRM_ERROR(
> - "Cannot allocate memory for context bitmap.\n");
> - goto err_ht;
> - }
> + drm_legacy_ctxbitmap_init(dev);
>
> if (drm_core_check_feature(dev, DRIVER_GEM)) {
> ret = drm_gem_init(dev);
> @@ -605,7 +598,6 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver,
>
> err_ctxbitmap:
> drm_legacy_ctxbitmap_cleanup(dev);
> -err_ht:
> drm_ht_remove(&dev->map_hash);
> err_minors:
> drm_minor_free(dev, DRM_MINOR_LEGACY);
> diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
> index c1dc61473db5..9b731786e4db 100644
> --- a/drivers/gpu/drm/drm_legacy.h
> +++ b/drivers/gpu/drm/drm_legacy.h
> @@ -42,7 +42,7 @@ struct drm_file;
> #define DRM_KERNEL_CONTEXT 0
> #define DRM_RESERVED_CONTEXTS 1
>
> -int drm_legacy_ctxbitmap_init(struct drm_device *dev);
> +void drm_legacy_ctxbitmap_init(struct drm_device *dev);
> void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
> void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
> void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
Reviewed-by: Peter Antoine <peter.antoine@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-06-23 13:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 9:37 [PATCH 1/3] drm: Turn off Legacy Context Functions Daniel Vetter
2015-06-23 9:37 ` [PATCH 2/3] drm: Convert drm_legacy_ctxbitmap_init to void return type Daniel Vetter
2015-06-23 13:15 ` Antoine, Peter [this message]
2015-06-23 9:37 ` [PATCH 3/3] drm: Reject DRI1 hw lock ioctl functions for kms drivers Daniel Vetter
2015-06-23 13:16 ` Antoine, Peter
2015-06-23 13:14 ` [PATCH 1/3] drm: Turn off Legacy Context Functions Antoine, Peter
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=1435065305.22268.2.camel@peterant-linux \
--to=peter.antoine@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@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