From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Move rotation validity check into its own function
Date: Tue, 14 Nov 2017 16:25:15 +0200 [thread overview]
Message-ID: <20171114142515.GF10981@intel.com> (raw)
In-Reply-To: <1510229160-329-2-git-send-email-juhapekka.heikkila@gmail.com>
On Thu, Nov 09, 2017 at 02:05:59PM +0200, Juha-Pekka Heikkila wrote:
> This makes intel_plane_atomic_check_with_state() generally shorter.
>
> v2: (Ville Syrjälä) move all rotation related checks from
> intel_plane_atomic_check_with_state into new function
> and don't pass dev_priv pointer around.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
> drivers/gpu/drm/i915/intel_atomic_plane.c | 81 ++++++++++++++++++-------------
> 1 file changed, 48 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index 8e6dc15..ffd36fb 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -107,6 +107,53 @@ intel_plane_destroy_state(struct drm_plane *plane,
> drm_atomic_helper_plane_destroy_state(plane, state);
> }
>
> +static bool intel_valid_rotation(const struct drm_plane_state *plane_state)
Maybe "intel_plane_valid_rotation" to make it more obvious what we're
checking here.
> +{
> + struct intel_plane *plane = to_intel_plane(plane_state->plane);
> + struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> +
> + if (plane_state->fb &&
> + drm_rotation_90_or_270(plane_state->rotation)) {
^^^^^^^^^^^^
Messed up alignment.
> + struct drm_format_name_buf format_name;
> +
> + if (plane_state->fb->modifier != I915_FORMAT_MOD_Y_TILED &&
> + plane_state->fb->modifier != I915_FORMAT_MOD_Yf_TILED) {
> + DRM_DEBUG_KMS("Y/Yf tiling required for 90/270!\n");
> + return false;
> + }
> +
> + /*
> + * 90/270 is not allowed with RGB64 16:16:16:16,
> + * RGB 16-bit 5:6:5, and Indexed 8-bit.
> + * TBD: Add RGB64 case once its added in supported format
> + * list.
> + */
> + switch (plane_state->fb->format->format) {
> + case DRM_FORMAT_C8:
> + case DRM_FORMAT_RGB565:
> + DRM_DEBUG_KMS(
> + "Unsupported pixel format %s for 90/270!\n",
> + drm_get_format_name(
> + plane_state->fb->format->format,
> + &format_name));
Here too.
> + return false;
> + default:
> + break;
> + }
> + }
> +
> + /* CHV ignores the mirror bit when the rotate bit is set :( */
> + if (IS_CHERRYVIEW(dev_priv) &&
> + plane_state->rotation & DRM_MODE_ROTATE_180 &&
> + plane_state->rotation & DRM_MODE_REFLECT_X) {
> + DRM_DEBUG_KMS("Cannot rotate and reflect at the same time\n");
> + return false;
> + }
> +
> + return true;
> +
Empty line. IIRC 'checkpatch.pl --strict' should catch these for you.
> +}
> +
> int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
> struct intel_crtc_state *crtc_state,
> const struct intel_plane_state *old_plane_state,
> @@ -137,40 +184,8 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
> intel_state->clip.y2 =
> crtc_state->base.enable ? crtc_state->pipe_src_h : 0;
>
> - if (state->fb && drm_rotation_90_or_270(state->rotation)) {
> - struct drm_format_name_buf format_name;
> -
> - if (state->fb->modifier != I915_FORMAT_MOD_Y_TILED &&
> - state->fb->modifier != I915_FORMAT_MOD_Yf_TILED) {
> - DRM_DEBUG_KMS("Y/Yf tiling required for 90/270!\n");
> - return -EINVAL;
> - }
> -
> - /*
> - * 90/270 is not allowed with RGB64 16:16:16:16,
> - * RGB 16-bit 5:6:5, and Indexed 8-bit.
> - * TBD: Add RGB64 case once its added in supported format list.
> - */
> - switch (state->fb->format->format) {
> - case DRM_FORMAT_C8:
> - case DRM_FORMAT_RGB565:
> - DRM_DEBUG_KMS("Unsupported pixel format %s for 90/270!\n",
> - drm_get_format_name(state->fb->format->format,
> - &format_name));
> - return -EINVAL;
> -
> - default:
> - break;
> - }
> - }
> -
> - /* CHV ignores the mirror bit when the rotate bit is set :( */
> - if (IS_CHERRYVIEW(dev_priv) &&
> - state->rotation & DRM_MODE_ROTATE_180 &&
> - state->rotation & DRM_MODE_REFLECT_X) {
> - DRM_DEBUG_KMS("Cannot rotate and reflect at the same time\n");
> + if (!intel_valid_rotation(state))
> return -EINVAL;
> - }
>
> intel_state->base.visible = false;
> ret = intel_plane->check_plane(intel_plane, crtc_state, intel_state);
> --
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-14 14:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 12:05 [PATCH 0/2] drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 Juha-Pekka Heikkila
2017-11-09 12:05 ` [PATCH 1/2] drm/i915: Move rotation validity check into its own function Juha-Pekka Heikkila
2017-11-14 14:25 ` Ville Syrjälä [this message]
2017-11-09 12:06 ` [PATCH 2/2] drm/i915: Enable 16bpp 90/270 plane rotation for gen10 onwards Juha-Pekka Heikkila
2017-11-09 13:11 ` ✗ Fi.CI.BAT: warning for drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 (rev2) Patchwork
2017-11-14 12:05 ` ✓ Fi.CI.BAT: success " Patchwork
2017-11-14 12:54 ` ✓ Fi.CI.IGT: " Patchwork
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=20171114142515.GF10981@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=juhapekka.heikkila@gmail.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 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.