From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/atomic: Fix outdated comment.
Date: Wed, 4 Jan 2017 12:15:55 +0100 [thread overview]
Message-ID: <7f9a208d-519c-c392-e338-eac5f37d212a@linux.intel.com> (raw)
In-Reply-To: <20161215151913.3ey34pnci3wahwum@phenom.ffwll.local>
Op 15-12-16 om 16:19 schreef Daniel Vetter:
> On Thu, Dec 15, 2016 at 03:29:42PM +0100, Maarten Lankhorst wrote:
>> drm_atomic_state_put is called unconditionally, so TEST_ONLY is no
>> different from commit.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> I think it'd be good to update the kerneldoc for the atomic_commit
> callback to mention that drivers should grab their own references using
> drm_atomic_state_get() when they need it.
>
> Applied this one meanwhile, thanks.
--->8---
Commit 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state")
adds reference counting to atomic state, but didn't update the comments
in drm_atomic_(nonblocking_)commit. Clarify lifetime a bit more.
Fixes: 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state")
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 681d5f97639d..6492546476b4 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1599,10 +1599,9 @@ EXPORT_SYMBOL(drm_atomic_check_only);
* more locks but encountered a deadlock. The caller must then do the usual w/w
* backoff dance and restart. All other errors are fatal.
*
- * Also note that on successful execution ownership of @state is transferred
- * from the caller of this function to the function itself. The caller must not
- * free or in any other way access @state. If the function fails then the caller
- * must clean up @state itself.
+ * In earlier versions of the atomic api, the caller was handing its reference
+ * of @state over to this function on success. This is no longer the case, and
+ * callers should always call drm_atomic_state_put().
*
* Returns:
* 0 on success, negative error code on failure.
@@ -1630,10 +1629,9 @@ EXPORT_SYMBOL(drm_atomic_commit);
* more locks but encountered a deadlock. The caller must then do the usual w/w
* backoff dance and restart. All other errors are fatal.
*
- * Also note that on successful execution ownership of @state is transferred
- * from the caller of this function to the function itself. The caller must not
- * free or in any other way access @state. If the function fails then the caller
- * must clean up @state itself.
+ * In earlier versions of the atomic api, the caller was handing its reference
+ * of @state over to this function on success. This is no longer the case, and
+ * callers should always call drm_atomic_state_put().
*
* Returns:
* 0 on success, negative error code on failure.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-01-04 11:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 14:29 [PATCH 0/4] drm: Resurrect atomic rmfb code Maarten Lankhorst
2016-12-15 14:29 ` [PATCH 1/4] drm/atomic: Delete wrong comment Maarten Lankhorst
2016-12-15 15:19 ` [Intel-gfx] " Daniel Vetter
2017-01-04 11:15 ` Maarten Lankhorst [this message]
2017-01-04 11:22 ` [PATCH] drm/atomic: Fix outdated comment Chris Wilson
2017-01-04 11:28 ` Daniel Vetter
2017-01-04 11:34 ` [PATCH v2] " Maarten Lankhorst
2017-01-04 15:41 ` Daniel Vetter
2016-12-15 14:29 ` [PATCH 2/4] drm/i915: Fix POWER_DOMAIN_AUDIO refcounting Maarten Lankhorst
2017-01-11 16:13 ` Daniel Vetter
2017-01-16 11:00 ` Maarten Lankhorst
2017-01-23 7:43 ` [Intel-gfx] " Daniel Vetter
2016-12-15 14:29 ` [PATCH 3/4] drm/i915: Disable all crtcs during driver unload Maarten Lankhorst
2017-01-11 16:15 ` Daniel Vetter
2016-12-15 14:29 ` [PATCH 4/4] drm: Resurrect atomic rmfb code, v2 Maarten Lankhorst
2017-01-11 16:15 ` Daniel Vetter
2017-01-24 21:44 ` Matt Roper
2017-01-25 4:54 ` Daniel Vetter
2017-01-25 8:09 ` Thomas Hellstrom
2017-01-25 8:36 ` Maarten Lankhorst
2017-01-25 18:05 ` Sinclair Yeh
2017-01-26 9:55 ` Maarten Lankhorst
2017-01-26 18:39 ` Sinclair Yeh
2017-02-09 12:29 ` Maarten Lankhorst
2017-02-09 15:58 ` Sinclair Yeh
2017-01-25 11:30 ` [PATCH v3 4/4] drm: Resurrect atomic rmfb code, v3 Maarten Lankhorst
2017-02-15 13:56 ` Jani Nikula
2017-02-15 16:28 ` [Intel-gfx] " Sinclair Yeh
2017-02-16 9:45 ` Jani Nikula
2017-02-16 11:00 ` [Intel-gfx] " Maarten Lankhorst
2016-12-15 16:23 ` ✗ Fi.CI.BAT: warning for drm: Resurrect atomic rmfb code Patchwork
2016-12-15 16:25 ` Maarten Lankhorst
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=7f9a208d-519c-c392-e338-eac5f37d212a@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=daniel@ffwll.ch \
--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 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.