* [PATCH 0/2] drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10
@ 2017-11-09 12:05 Juha-Pekka Heikkila
2017-11-09 12:05 ` [PATCH 1/2] drm/i915: Move rotation validity check into its own function Juha-Pekka Heikkila
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Juha-Pekka Heikkila @ 2017-11-09 12:05 UTC (permalink / raw)
To: intel-gfx
90/270 16bpp rotation is supported in hadrware from Gen10 onwards. I modified
kms_rotation_crc igt test to test this feature:
https://patchwork.freedesktop.org/patch/186179/
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.
/Juha-Pekka
Juha-Pekka Heikkila (2):
drm/i915: Move 90/270 rotation validity check into its own function
drm/i915: Enable 16bpp 90/270 plane rotation for gen10 onwards.
drivers/gpu/drm/i915/intel_atomic_plane.c | 84 +++++++++++++++++++------------
1 file changed, 51 insertions(+), 33 deletions(-)
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] drm/i915: Move rotation validity check into its own function
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 ` Juha-Pekka Heikkila
2017-11-14 14:25 ` Ville Syrjälä
2017-11-09 12:06 ` [PATCH 2/2] drm/i915: Enable 16bpp 90/270 plane rotation for gen10 onwards Juha-Pekka Heikkila
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Juha-Pekka Heikkila @ 2017-11-09 12:05 UTC (permalink / raw)
To: intel-gfx
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)
+{
+ 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)) {
+ 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));
+ 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;
+
+}
+
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] drm/i915: Enable 16bpp 90/270 plane rotation for gen10 onwards.
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-09 12:06 ` 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
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Juha-Pekka Heikkila @ 2017-11-09 12:06 UTC (permalink / raw)
To: intel-gfx
From gen10 onwards 16bpp 90/270 plane rotation is supported on hardware.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Testcase: https://patchwork.freedesktop.org/patch/186179/
---
drivers/gpu/drm/i915/intel_atomic_plane.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index ffd36fb..d321e31 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -123,14 +123,17 @@ static bool intel_valid_rotation(const struct drm_plane_state *plane_state)
}
/*
- * 90/270 is not allowed with RGB64 16:16:16:16,
- * RGB 16-bit 5:6:5, and Indexed 8-bit.
+ * 90/270 is not allowed with RGB64 16:16:16:16 and
+ * Indexed 8-bit. RGB 16-bit. 5:6:5 is allowed gen10 onwards.
* 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:
+ if (INTEL_GEN(dev_priv) >= 10)
+ break;
+ /* fall through */
+ case DRM_FORMAT_C8:
DRM_DEBUG_KMS(
"Unsupported pixel format %s for 90/270!\n",
drm_get_format_name(
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* ✗ Fi.CI.BAT: warning for drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 (rev2)
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-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 ` Patchwork
2017-11-14 12:05 ` ✓ Fi.CI.BAT: success " Patchwork
2017-11-14 12:54 ` ✓ Fi.CI.IGT: " Patchwork
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2017-11-09 13:11 UTC (permalink / raw)
To: Juha-Pekka Heikkila; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 (rev2)
URL : https://patchwork.freedesktop.org/series/33133/
State : warning
== Summary ==
Series 33133v2 drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10
https://patchwork.freedesktop.org/api/1.0/series/33133/revisions/2/mbox/
Test chamelium:
Subgroup dp-crc-fast:
pass -> FAIL (fi-kbl-7500u) fdo#102514
Test gem_exec_reloc:
Subgroup basic-gtt-active:
fail -> PASS (fi-gdg-551) fdo#102582 +2
Test kms_pipe_crc_basic:
Subgroup nonblocking-crc-pipe-b-frame-sequence:
pass -> SKIP (fi-hsw-4770r)
fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:454s
fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:450s
fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:377s
fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:548s
fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:273s
fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:505s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:511s
fi-byt-j1900 total:289 pass:254 dwarn:0 dfail:0 fail:0 skip:35 time:500s
fi-byt-n2820 total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:494s
fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:431s
fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:261s
fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:544s
fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:433s
fi-hsw-4770r total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:440s
fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:431s
fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:484s
fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:469s
fi-kbl-7500u total:289 pass:263 dwarn:1 dfail:0 fail:1 skip:24 time:478s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:523s
fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:475s
fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:540s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:450s
fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:552s
fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:566s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:518s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:497s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:458s
fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:561s
fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:431s
Blacklisted hosts:
fi-cnl-y total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:585s
fi-glk-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:494s
fi-pnv-d510 failed to connect after reboot
65dc54b704d3ee0486f9f5b11f00c28973f783a2 drm-tip: 2017y-11m-09d-08h-53m-46s UTC integration manifest
96b348bbc337 drm/i915: Enable 16bpp 90/270 plane rotation for gen10 onwards.
7789e54ffd7e drm/i915: Move rotation validity check into its own function
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7037/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 (rev2)
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
` (2 preceding siblings ...)
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 ` Patchwork
2017-11-14 12:54 ` ✓ Fi.CI.IGT: " Patchwork
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2017-11-14 12:05 UTC (permalink / raw)
To: Juha-Pekka Heikkila; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 (rev2)
URL : https://patchwork.freedesktop.org/series/33133/
State : success
== Summary ==
Series 33133v2 drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10
https://patchwork.freedesktop.org/api/1.0/series/33133/revisions/2/mbox/
Test chamelium:
Subgroup dp-crc-fast:
fail -> PASS (fi-kbl-7500u) fdo#102514
fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:444s
fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:457s
fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:381s
fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:530s
fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:276s
fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:507s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:500s
fi-byt-j1900 total:289 pass:254 dwarn:0 dfail:0 fail:0 skip:35 time:491s
fi-byt-n2820 total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:492s
fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:420s
fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:262s
fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:538s
fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:430s
fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:438s
fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:425s
fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:473s
fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:463s
fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:485s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:520s
fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:472s
fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:530s
fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:572s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:455s
fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:543s
fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:565s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:521s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:500s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:461s
fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:563s
fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:419s
Blacklisted hosts:
fi-cfl-s total:289 pass:242 dwarn:14 dfail:1 fail:0 skip:32 time:543s
fi-cnl-y total:289 pass:261 dwarn:0 dfail:0 fail:1 skip:27 time:548s
fi-glk-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:492s
150c0315ce448d88e22e7e675eed6e55abbe04cd drm-tip: 2017y-11m-14d-10h-02m-23s UTC integration manifest
9df365487078 drm/i915: Enable 16bpp 90/270 plane rotation for gen10 onwards.
30fefb897e8b drm/i915: Move rotation validity check into its own function
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7110/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 (rev2)
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
` (3 preceding siblings ...)
2017-11-14 12:05 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2017-11-14 12:54 ` Patchwork
4 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2017-11-14 12:54 UTC (permalink / raw)
To: Juha-Pekka Heikkila; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: This set enables 90/270 degree rotation on 16bpp planes on gen10 (rev2)
URL : https://patchwork.freedesktop.org/series/33133/
State : success
== Summary ==
Warning: bzip CI_DRM_3343/shard-glkb6/results34.json.bz2 wasn't in correct JSON format
Test kms_busy:
Subgroup extended-modeset-hang-newfb-with-reset-render-b:
pass -> DMESG-WARN (shard-hsw) fdo#103038
Subgroup extended-modeset-hang-oldfb-with-reset-render-a:
pass -> DMESG-WARN (shard-hsw) fdo#102249
Test kms_setmode:
Subgroup basic:
fail -> PASS (shard-hsw) fdo#99912
Test drv_module_reload:
Subgroup basic-reload:
dmesg-warn -> PASS (shard-hsw) fdo#102707
fdo#103038 https://bugs.freedesktop.org/show_bug.cgi?id=103038
fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
shard-hsw total:2584 pass:1472 dwarn:3 dfail:1 fail:9 skip:1099 time:9480s
Blacklisted hosts:
shard-apl total:2584 pass:1623 dwarn:2 dfail:1 fail:22 skip:936 time:12965s
shard-kbl total:2554 pass:1699 dwarn:6 dfail:1 fail:23 skip:823 time:10306s
shard-snb total:2584 pass:1200 dwarn:2 dfail:1 fail:13 skip:1368 time:7797s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7110/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] drm/i915: Move rotation validity check into its own function
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ä
0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2017-11-14 14:25 UTC (permalink / raw)
To: Juha-Pekka Heikkila; +Cc: intel-gfx
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-11-14 14:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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ä
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
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.