From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Clean up intel_plane->plane usage
Date: Mon, 21 Sep 2015 08:17:56 +0200 [thread overview]
Message-ID: <55FFA114.5050306@linux.intel.com> (raw)
In-Reply-To: <1442541321-23813-1-git-send-email-matthew.d.roper@intel.com>
Op 18-09-15 om 03:55 schreef Matt Roper:
> intel_plane->plane has inconsistent meanings across the driver:
> * For primary planes, intel_plane->plane is usually the pipe number
> (except for old platforms where it had to be swapped for FBC
> reasons).
> * For sprite planes, intel_plane->plane represents the sprite index for
> the specific CRTC the sprite belongs to (0, 1, 2, ...)
> * For cursor planes, intel_plane->plane is again the pipe number,
> but without the FBC swapping on old platforms.
>
> This overloading of the field can be quite confusing and easily leads to
> bugs due to differences in how the hardware actually gets programmed
> (e.g., SKL code needs to use p->plane + 1 because the hardware expects
> universal plane ID's that include the primary, whereas VLV code needs to
> use just p->plane because hardware expects a sprite index that does not
> include the primary).
>
> Let's try to clean up this situation by giving intel_plane->plane a
> consistent meaning across all plane types, and then update all uses
> across driver code to use macros to interpret it properly. The
> following macros should be used in the code where we previously accessed
> p->plane and will do additional plane type checking to help prevent
> misuse:
> * I915_UNIVERSAL_NUM(p) --- Universal plane ID (primary = 0, sprites
> start from 1); intended for use in gen9+ code.
> * I915_I915_PRIMARY_NUM(p) --- Primary plane ID for pre-gen9 platforms;
> determines whether FBC-related swapping is needed or not.
The extra I915_ here should probably be fixed when committing, though it's
not sufficient to require a resend of this patch. :-)
> * I915_SPRITE_NUM(p) --- Sprite plane ID (first sprite = 0); intended
> for use in pre-gen9 code.
>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2015-09-21 6:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 1:55 [PATCH] drm/i915: Clean up intel_plane->plane usage Matt Roper
2015-09-18 8:48 ` Ville Syrjälä
2015-09-23 13:52 ` Daniel Vetter
2015-09-21 6:17 ` Maarten Lankhorst [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=55FFA114.5050306@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.d.roper@intel.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