From: Takashi Iwai <tiwai@suse.de>
To: Michel D4nzer <michel@daenzer.net>
Cc: "Tomáš Chvátal" <tchvatal@suse.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/radeon: Fix negative cursor position
Date: Thu, 27 Oct 2016 11:39:38 +0200 [thread overview]
Message-ID: <s5hzilqp1ut.wl-tiwai@suse.de> (raw)
In-Reply-To: <7a6f53a0-01d7-4a69-cfc7-dcd841945c49@daenzer.net>
On Thu, 27 Oct 2016 11:02:30 +0200,
Michel D4nzer wrote:
>
> On 26/09/16 09:09 PM, Takashi Iwai wrote:
> > On Mon, 26 Sep 2016 11:42:16 +0200, Takashi Iwai wrote:
> >> On Mon, 26 Sep 2016 10:57:50 +0200, Michel D4nzer wrote:
> >>> On 23/09/16 10:06 PM, Takashi Iwai wrote:
> >>>> radeon_cursor_move_unlock() contains a workaround for AVIVO chips that
> >>>> are older than DCE6 when the cursor ends on 128 pixel boundary. It
> >>>> decreases the position when the calculated end position is on 128
> >>>> pixel boundary. However, it hits also the condition where x=-1 and
> >>>> width=1 are passed, since cursor_end is 0 (which is aligned with 128,
> >>>> too). Then the value gets decreased and it hits WARN_ON_ONCE()
> >>>> below, eventually screws up the GPU.
> >>>>
> >>>> The fix is simply to skip the workaround when x is already zero.
> >>>> Also, remove the superfluous WARN_ON_ON() for the negative value check
> >>>> that wouldn't happen any longer after this change.
> >>>>
> >>>> Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1000433
> >>>> Cc: <stable@vger.kernel.org>
> >>>> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> >>>> ---
> >>>> drivers/gpu/drm/radeon/radeon_cursor.c | 4 +---
> >>>> 1 file changed, 1 insertion(+), 3 deletions(-)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
> >>>> index 2a10e24b34b1..4e436eb49a56 100644
> >>>> --- a/drivers/gpu/drm/radeon/radeon_cursor.c
> >>>> +++ b/drivers/gpu/drm/radeon/radeon_cursor.c
> >>>> @@ -193,10 +193,8 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)
> >>>> if (w <= 0) {
> >>>> w = 1;
> >>>> cursor_end = x - xorigin + w;
> >>>> - if (!(cursor_end & 0x7f)) {
> >>>> + if (x > 0 && !(cursor_end & 0x7f))
> >>>> x--;
> >>>> - WARN_ON_ONCE(x < 0);
> >>>> - }
> >>>> }
> >>>
> >>> The problem with this change is that the horizontal cursor end position
> >>> can again and up as a multiple of 128, which this code is trying to
> >>> avoid, because it can break the cursor with some versions of AVIVO / DCE
> >>> display engines.
> >>>
> >>> Attached is a proof-of-concept (only compile tested) alternative fix
> >>> which hides the cursor while it's out of bounds. I'll test it, clean it
> >>> up and split it up into multiple patches when I get a chance, but maybe
> >>> you or the reporter of the referenced bug can test it in the meantime.
> >>
> >> Sure, I'll ask the reporter to test with your tentative fix.
> >
> > Through a quick test by Tomas (added to Cc), the new patch seems
> > working.
>
> Thanks for testing, Tomáš! I sent an updated patch series to the amd-gfx
> mailing list and put you guys in Cc.
Thanks!
I updated the test package with your latest patchset for openSUSE
Tumbleweed:
https://bugzilla.suse.com/show_bug.cgi?id=1000433
Feel free to join to the bugzilla.
Takashi
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2016-10-27 9:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 13:06 [PATCH] drm/radeon: Fix negative cursor position Takashi Iwai
2016-09-26 8:57 ` Michel Dänzer
2016-09-26 9:42 ` Takashi Iwai
2016-09-26 12:09 ` Takashi Iwai
2016-10-27 9:02 ` Michel Dänzer
2016-10-27 9:39 ` Takashi Iwai [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=s5hzilqp1ut.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=michel@daenzer.net \
--cc=tchvatal@suse.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