All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: Keith Packard <keithp@keithp.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Dave Airlie <airlied@redhat.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 4/6] drm: Add drm_object lease infrastructure [v3]
Date: Thu, 5 Oct 2017 13:55:49 +1000	[thread overview]
Message-ID: <CAPM=9tyHJnYmxs2zbXV=FuC+PC9tck=EM6SYYC+jV4H_VOcNRA@mail.gmail.com> (raw)
In-Reply-To: <20170705222406.28124-5-keithp@keithp.com>

> + *
> + * drm_master at the top of the tree (i.e, with lessor NULL
> + */
> +struct drm_master *drm_lease_owner(struct drm_master *master) {

^ there's a couple of misplaced braces around. start of next line please.


> +       while (master->lessor != NULL)
> +               master = master->lessor;
> +       return master;
> +}
> +EXPORT_SYMBOL(drm_lease_owner);
> +
> +/**
> + * _drm_find_lessee - find lessee by id
> + * @master: drm_master of lessor
> + * @id: lessee_id
> + *
> + * RETURN:
> + *
> + * drm_master of the lessee if valid, NULL otherwise
> + */
> +
> +static struct drm_master*
> +_drm_find_lessee(struct drm_master *master, int lessee_id)
> +{
> +       return idr_find(&drm_lease_owner(master)->lessee_idr, lessee_id);
> +}
> +
> +/**
> + * _drm_lease_held_master - check to see if an object is leased (or owned) by master
> + * @master: the master to check the lease status of
> + * @id: the id to check
> + *
> + * Checks if the specified master holds a lease on the object. Return
> + * value:
> + *
> + *     true            'master' holds a lease on (or owns) the object
> + *     false           'master' does not hold a lease.
> + */
> +static int _drm_lease_held_master(struct drm_master *master, int id) {

^^ here as well.

> +       lockdep_assert_held(&master->dev->mode_config.idr_mutex);
> +       if (master->lessor)
> +               return idr_find(&master->leases, id) != NULL;
> +       return true;
> +}
> +
> +/**
> + * _drm_has_leased - check to see if an object has been leased
> + * @master: the master to check the lease status of
> + * @id: the id to check
> + *
> + * Checks if any lessee of 'master' holds a lease on 'id'. Return
> + * value:
> + *
> + *     true            Some lessee holds a lease on the object.
> + *     false           No lessee has a lease on the object.
> + */
> +static bool _drm_has_leased(struct drm_master *master, int id) {

^^ here as well


> +}
> +EXPORT_SYMBOL(drm_lease_held);
> +
> +/**
> + * drm_lease_filter_crtcs - restricted crtc set to leased values
> + * @file_priv: requestor file
> + * @crtcs: bitmask of crtcs to check
> + *
> + * Reconstructs a crtc mask based on the crtcs which are visible
> + * through the specified file.
> + */
> +uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in)
> +{
> +       struct drm_master *master;
> +       struct drm_device *dev;
> +       struct drm_crtc *crtc;
> +       int count_in, count_out;
> +       uint32_t crtcs_out = 0;
> +
> +       if (file_priv == NULL || file_priv->master == NULL)
> +               return crtcs_in;
> +
> +       master = file_priv->master;
> +       dev = master->dev;
> +
> +       count_in = count_out = 0;
> +       mutex_lock(&master->dev->mode_config.idr_mutex);
> +       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
> +               if (_drm_lease_held_master(master, crtc->base.id)) {
> +                       uint32_t        mask_in = 1ul << count_in;
> +                       if ((crtcs_in & mask_in) != 0) {
> +                               uint32_t        mask_out = 1ul << count_out;
> +                               crtcs_out |= mask_out;

There are a couple of stray tab chars in here ^

> +       mutex_lock(&master->dev->mode_config.idr_mutex);
> +       list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
> +               if (_drm_lease_held_master(master, encoder->base.id)) {
> +                       uint32_t        mask_in = 1ul << count_in;
> +                       if ((encoders_in & mask_in) != 0) {
> +                               uint32_t        mask_out = 1ul << count_out;
> +                               encoders_out |= mask_out;

And here ^

Dave.

WARNING: multiple messages have this Message-ID (diff)
From: Dave Airlie <airlied@gmail.com>
To: Keith Packard <keithp@keithp.com>
Cc: Dave Airlie <airlied@redhat.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/6] drm: Add drm_object lease infrastructure [v3]
Date: Thu, 5 Oct 2017 13:55:49 +1000	[thread overview]
Message-ID: <CAPM=9tyHJnYmxs2zbXV=FuC+PC9tck=EM6SYYC+jV4H_VOcNRA@mail.gmail.com> (raw)
In-Reply-To: <20170705222406.28124-5-keithp@keithp.com>

> + *
> + * drm_master at the top of the tree (i.e, with lessor NULL
> + */
> +struct drm_master *drm_lease_owner(struct drm_master *master) {

^ there's a couple of misplaced braces around. start of next line please.


> +       while (master->lessor != NULL)
> +               master = master->lessor;
> +       return master;
> +}
> +EXPORT_SYMBOL(drm_lease_owner);
> +
> +/**
> + * _drm_find_lessee - find lessee by id
> + * @master: drm_master of lessor
> + * @id: lessee_id
> + *
> + * RETURN:
> + *
> + * drm_master of the lessee if valid, NULL otherwise
> + */
> +
> +static struct drm_master*
> +_drm_find_lessee(struct drm_master *master, int lessee_id)
> +{
> +       return idr_find(&drm_lease_owner(master)->lessee_idr, lessee_id);
> +}
> +
> +/**
> + * _drm_lease_held_master - check to see if an object is leased (or owned) by master
> + * @master: the master to check the lease status of
> + * @id: the id to check
> + *
> + * Checks if the specified master holds a lease on the object. Return
> + * value:
> + *
> + *     true            'master' holds a lease on (or owns) the object
> + *     false           'master' does not hold a lease.
> + */
> +static int _drm_lease_held_master(struct drm_master *master, int id) {

^^ here as well.

> +       lockdep_assert_held(&master->dev->mode_config.idr_mutex);
> +       if (master->lessor)
> +               return idr_find(&master->leases, id) != NULL;
> +       return true;
> +}
> +
> +/**
> + * _drm_has_leased - check to see if an object has been leased
> + * @master: the master to check the lease status of
> + * @id: the id to check
> + *
> + * Checks if any lessee of 'master' holds a lease on 'id'. Return
> + * value:
> + *
> + *     true            Some lessee holds a lease on the object.
> + *     false           No lessee has a lease on the object.
> + */
> +static bool _drm_has_leased(struct drm_master *master, int id) {

^^ here as well


> +}
> +EXPORT_SYMBOL(drm_lease_held);
> +
> +/**
> + * drm_lease_filter_crtcs - restricted crtc set to leased values
> + * @file_priv: requestor file
> + * @crtcs: bitmask of crtcs to check
> + *
> + * Reconstructs a crtc mask based on the crtcs which are visible
> + * through the specified file.
> + */
> +uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in)
> +{
> +       struct drm_master *master;
> +       struct drm_device *dev;
> +       struct drm_crtc *crtc;
> +       int count_in, count_out;
> +       uint32_t crtcs_out = 0;
> +
> +       if (file_priv == NULL || file_priv->master == NULL)
> +               return crtcs_in;
> +
> +       master = file_priv->master;
> +       dev = master->dev;
> +
> +       count_in = count_out = 0;
> +       mutex_lock(&master->dev->mode_config.idr_mutex);
> +       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
> +               if (_drm_lease_held_master(master, crtc->base.id)) {
> +                       uint32_t        mask_in = 1ul << count_in;
> +                       if ((crtcs_in & mask_in) != 0) {
> +                               uint32_t        mask_out = 1ul << count_out;
> +                               crtcs_out |= mask_out;

There are a couple of stray tab chars in here ^

> +       mutex_lock(&master->dev->mode_config.idr_mutex);
> +       list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
> +               if (_drm_lease_held_master(master, encoder->base.id)) {
> +                       uint32_t        mask_in = 1ul << count_in;
> +                       if ((encoders_in & mask_in) != 0) {
> +                               uint32_t        mask_out = 1ul << count_out;
> +                               encoders_out |= mask_out;

And here ^

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

  reply	other threads:[~2017-10-05  3:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 22:24 [PATCH 0/6] drm: Add mode object leases [v3] Keith Packard
2017-07-05 22:24 ` Keith Packard
2017-07-05 22:24 ` [PATCH 1/6] drm: Pass struct drm_file * to __drm_mode_object_find Keith Packard
2017-07-05 22:24   ` Keith Packard
2017-07-05 22:24 ` [PATCH 2/6] drm: Allow render nodes to query display objects Keith Packard
2017-07-05 22:24   ` Keith Packard
2017-07-05 22:24 ` [PATCH 3/6] drm: Add new LEASE debug level Keith Packard
2017-07-05 22:24   ` Keith Packard
2017-07-05 22:24 ` [PATCH 4/6] drm: Add drm_object lease infrastructure [v3] Keith Packard
2017-10-05  3:55   ` Dave Airlie [this message]
2017-10-05  3:55     ` Dave Airlie
2017-07-05 22:24 ` [PATCH 5/6] drm: Check mode object lease status in all master ioctl paths [v2] Keith Packard
2017-07-05 22:24   ` Keith Packard
2017-07-05 22:24 ` [PATCH 6/6] drm: Add four ioctls for managing drm mode object leases [v3] Keith Packard
2017-07-05 22:24   ` Keith Packard
2017-07-06  0:42   ` Dave Airlie
2017-07-06  0:42     ` Dave Airlie
2017-07-06  3:38     ` Keith Packard
2017-07-06  3:38       ` Keith Packard
2017-10-05  3:17   ` Dave Airlie
2017-10-05  3:24     ` Dave Airlie
2017-10-05  3:24       ` Dave Airlie
2017-10-05  3:37       ` Dave Airlie
2017-10-05  3:37         ` Dave Airlie
2017-10-05  6:23         ` Keith Packard
2017-10-05  6:23           ` Keith Packard

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='CAPM=9tyHJnYmxs2zbXV=FuC+PC9tck=EM6SYYC+jV4H_VOcNRA@mail.gmail.com' \
    --to=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.