dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Julian Margetson <runaway@candw.ms>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Subject: Re: [Powerpc] Sam460ex Canyonlands issue -Kernel 4.4.6-rc1
Date: Thu, 31 Mar 2016 15:50:41 +0900	[thread overview]
Message-ID: <56FCC8C1.7030706@daenzer.net> (raw)
In-Reply-To: <56FBAC12.7080303@candw.ms>

[-- Attachment #1: Type: text/plain, Size: 2091 bytes --]

On 30.03.2016 19:36, Julian Margetson wrote:
> On 3/29/2016 11:49 PM, Michel Dänzer wrote:
>> On 29.03.2016 18:55, Julian Margetson wrote:
>>> On 3/28/2016 11:15 PM, Michel Dänzer wrote:
>>>> On 29.03.2016 08:47, Julian Margetson wrote:
>>>>> Seeing the following when booting kernel 4.6-rc1 on Acube Sam460ex
>>>>> Canyonlands board.
>>>>> This loops for a few times then the kernel boots.
>>>>> No problem with the 4.6-rc1 with an A-eon Tabor Freescale e500v2
>>>>> board.
>>>>>
>>>>> Regards
>>>>>
>>>>> Julian
>>>>>
>>>>>
>>>>>    [    2.197839] ------------[ cut here ]------------
>>>>>    [    2.197850] WARNING: CPU: 0 PID: 1 at
>>>>> drivers/gpu/drm/drm_irq.c:1368 drm_vblank_off+0x2c/0x1e0
>>>> That's
>>>>
>>>>      if (WARN_ON(pipe >= dev->num_crtcs))
>>>>
>>>> My best guess is that drm_vblank_off is called before drm_vblank_init,
>>>> so dev->num_crtcs is still 0.
>>>>
>>>>
>>>> Please provide the full dmesg output corresponding to the problem.
>>>>
>>>>
>>> Attached
>> [...]
>>
>>> [drm] radeon: irq initialized.
>>> [drm:r600_ring_test] *ERROR* radeon: ring 0 test failed
>>> (scratch(0x850C)=0xCAFEDEAD)
>>> radeon 0001:81:00.0: disabling GPU acceleration
>> Okay, so the problem is that acceleration fails to initialize, in which
>> case the driver calls drm_vblank_cleanup.
>>
>> I can see two basic options for a solution: Either don't call
>> radeon_irq_kms_fini/drm_vblank_cleanup if acceleration fails to
>> initialize, or check if acceleration is enabled before calling
>> drm_vblank_on/off. Any preferences?
>>
>>
> Thanks
> 
> No preferences .

Does the attached patch fix the problem?


> I would be interested in a fix for the acceleration problem if possible .

Beware that while the kernel side of this might be relatively easy to
fix, making the userspace radeonsi driver work on big endian hosts would
likely require substantial effort.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: radeon-guard-vblank-on-off.diff --]
[-- Type: text/x-patch; name="radeon-guard-vblank-on-off.diff", Size: 1958 bytes --]

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index cf61e08..b80b08f 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -275,13 +275,15 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
 		if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev))
 			atombios_enable_crtc_memreq(crtc, ATOM_ENABLE);
 		atombios_blank_crtc(crtc, ATOM_DISABLE);
-		drm_vblank_on(dev, radeon_crtc->crtc_id);
+		if (dev->num_crtcs > radeon_crtc->crtc_id)
+			drm_vblank_on(dev, radeon_crtc->crtc_id);
 		radeon_crtc_load_lut(crtc);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		drm_vblank_off(dev, radeon_crtc->crtc_id);
+		if (dev->num_crtcs > radeon_crtc->crtc_id)
+			drm_vblank_off(dev, radeon_crtc->crtc_id);
 		if (radeon_crtc->enabled)
 			atombios_blank_crtc(crtc, ATOM_ENABLE);
 		if (ASIC_IS_DCE3(rdev) && !ASIC_IS_DCE6(rdev))
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index 24152df..478d409 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -331,13 +331,15 @@ static void radeon_crtc_dpms(struct drm_crtc *crtc, int mode)
 									 RADEON_CRTC_DISP_REQ_EN_B));
 			WREG32_P(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl, ~(mask | crtc_ext_cntl));
 		}
-		drm_vblank_on(dev, radeon_crtc->crtc_id);
+		if (dev->num_crtcs > radeon_crtc->crtc_id)
+			drm_vblank_on(dev, radeon_crtc->crtc_id);
 		radeon_crtc_load_lut(crtc);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		drm_vblank_off(dev, radeon_crtc->crtc_id);
+		if (dev->num_crtcs > radeon_crtc->crtc_id)
+			drm_vblank_off(dev, radeon_crtc->crtc_id);
 		if (radeon_crtc->crtc_id)
 			WREG32_P(RADEON_CRTC2_GEN_CNTL, mask, ~(RADEON_CRTC2_EN | mask));
 		else {

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-03-31  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-28 23:47 [Powerpc] Sam460ex Canyonlands issue -Kernel 4.4.6-rc1 Julian Margetson
2016-03-29  3:15 ` Michel Dänzer
2016-03-29  9:55   ` Julian Margetson
2016-03-30  3:49     ` Michel Dänzer
2016-03-30 10:36       ` Julian Margetson
2016-03-31  6:50         ` Michel Dänzer [this message]
2016-03-31 10:00           ` Julian Margetson
2016-04-01  8:31             ` Michel Dänzer
2016-04-01 10:33               ` Julian Margetson

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=56FCC8C1.7030706@daenzer.net \
    --to=michel@daenzer.net \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=runaway@candw.ms \
    /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