From: Brian Starkey <brian.starkey@arm.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t v2 5/5] lib/igt_kms: Remove redundant cursor code
Date: Mon, 20 Feb 2017 11:02:48 +0000 [thread overview]
Message-ID: <1487588568-5033-5-git-send-email-brian.starkey@arm.com> (raw)
In-Reply-To: <1487588568-5033-1-git-send-email-brian.starkey@arm.com>
The dynamic plane support means that there should never be gaps in the
pipe->planes array. This means we should never need to move the cursor
plane from the last slot to another.
Remove the unnecessary code, and add an assert that makes sure nothing
strange happened that broke the assignment logic.
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
---
lib/igt_kms.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 60c4c260bf2d..8751c97f7a06 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1679,20 +1679,11 @@ void igt_display_init(igt_display_t *display, int drm_fd)
*/
igt_assert_eq(pipe->plane_primary, 0);
- if (display->has_cursor_plane) {
- /*
- * Cursor was put in the last slot. If we have 0 or
- * only 1 sprite, that's the wrong slot and we need to
- * move it down.
- */
- if (p != last_plane) {
- pipe->planes[p] =
- pipe->planes[last_plane];
- pipe->planes[p].index = p;
- memset(&pipe->planes[last_plane], 0,
- sizeof *plane);
- }
- }
+ /*
+ * There should be no gaps. If there is, something happened
+ * which we can't handle (e.g. all planes are cursors).
+ */
+ igt_assert_eq(p, last_plane);
pipe->n_planes = n_planes;
--
1.7.9.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-02-20 11:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 11:02 [PATCH i-g-t v2 1/5] lib/igt_kms: Fix drm_plane leak Brian Starkey
2017-02-20 11:02 ` [PATCH i-g-t v2 2/5] lib/igt_kms: Neaten up pipe->planes[] assignment Brian Starkey
2017-02-20 11:02 ` [PATCH i-g-t v2 3/5] lib/igt_kms: Fix possible out-of-bounds access Brian Starkey
2017-02-20 11:02 ` [PATCH i-g-t v2 4/5] lib/igt_kms: Fix memory corruption when there's no cursor plane Brian Starkey
2017-02-20 11:02 ` Brian Starkey [this message]
2017-02-21 10:12 ` [PATCH i-g-t v2 1/5] lib/igt_kms: Fix drm_plane leak Brian Starkey
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=1487588568-5033-5-git-send-email-brian.starkey@arm.com \
--to=brian.starkey@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).