From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Liu Ying <gnuiyl@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 03/10] drm/imx: atomic phase 1: Use transitional atomic CRTC and plane helpers
Date: Sat, 13 Aug 2016 11:45:31 +0100 [thread overview]
Message-ID: <20160813104531.GA4844@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20160813101154.GA3864@n2100.armlinux.org.uk>
On Sat, Aug 13, 2016 at 11:11:54AM +0100, Russell King - ARM Linux wrote:
> On Mon, Jul 04, 2016 at 03:40:32PM +0800, Liu Ying wrote:
> > Use the drm_plane_helper_update/disable() and drm_helper_crtc_mode_set()
> > transitional atomic helpers. The crtc->mode_set_nofb callback is added
> > so that the primary plane is no longer tied to the CRTC. Check/update
> > logics are separated to make sure crtc->mode_set_nofb and plane->atomic_update
> > are always successful. Also, some necessary logics are tweaked for a smooth
> > transition.
> >
> > Signed-off-by: Liu Ying <gnuiyl@gmail.com>
>
> This patch causes a regression with my xorg ddx driver:
>
> [ 29.850] (EE) armada(0): [drm] failed to set mode on crtc 24: Invalid argument
>
> I'm not sure why (yet).
Hi,
Enabling DRM debugging doesn't seem to provide much in the way of clues:
[drm:drm_ioctl] pid=1015, dev=0xe200, auth=1, DRM_IOCTL_MODE_SETCRTC
[drm:drm_mode_setcrtc] [CRTC:24:crtc-0]
[drm:drm_mode_setcrtc] [CONNECTOR:34:HDMI-A-1]
[drm:drm_crtc_helper_set_config]
[drm:drm_crtc_helper_set_config] [CRTC:24:crtc-0] [FB:48] #connectors=1 (x y) (0 0)
[drm:drm_crtc_helper_set_config] [CONNECTOR:34:HDMI-A-1] to [CRTC:24:crtc-0]
[drm:drm_crtc_helper_set_config] attempting to set mode from userspace
[drm:drm_mode_debug_printmodeline] Modeline 49:"1920x1080" 0 148500 1920 2448 2492 2640 1080 1084 1089 1125 0x0 0x5
[drm:drm_crtc_helper_set_mode] [CRTC:24:crtc-0]
[drm:drm_vblank_off] crtc 0, vblank enabled 0, inmodeset 0
[drm:drm_update_vblank_count] updating vblank count on crtc 0: current=2, diff=0, hw=0 hw_last=0
[drm:drm_mode_object_reference] OBJ ID: 51 (1)
[drm:drm_mode_object_unreference] OBJ ID: 51 (2)
[drm:drm_atomic_set_mode_for_crtc] Set [MODE:1920x1080] for CRTC state ed81ee00
[drm:drm_mode_object_reference] OBJ ID: 47 (3)
[drm:drm_mode_object_unreference] OBJ ID: 47 (4)
[drm:drm_mode_object_reference] OBJ ID: 48 (2)
[drm:drm_atomic_set_fb_for_plane] Set [FB:48] for plane state ed632d00
[drm:drm_mode_object_unreference] OBJ ID: 48 (3)
[drm:drm_mode_object_unreference] OBJ ID: 51 (1)
[drm:drm_crtc_helper_set_config] *ERROR* failed to set mode on [CRTC:24:crtc-0]
[drm:drm_crtc_helper_set_mode] [CRTC:24:crtc-0]
[drm:drm_mode_object_reference] OBJ ID: 52 (1)
[drm:drm_mode_object_unreference] OBJ ID: 52 (2)
[drm:drm_atomic_set_mode_for_crtc] Set [MODE:1920x1080] for CRTC state ed81f600
[drm:drm_mode_object_reference] OBJ ID: 47 (3)
[drm:drm_mode_object_unreference] OBJ ID: 47 (4)
[drm:drm_mode_object_reference] OBJ ID: 47 (3)
[drm:drm_atomic_set_fb_for_plane] Set [FB:47] for plane state ed632d00
[drm:drm_mode_object_unreference] OBJ ID: 47 (4)
[drm:drm_mode_object_unreference] OBJ ID: 52 (1)
[drm:drm_crtc_helper_set_mode] [ENCODER:33:TMDS-33] set [MODE:46:1920x1080]
[drm:drm_vblank_on] crtc 0, vblank enabled 0, inmodeset 1
[drm:drm_calc_timestamping_constants] crtc 24: hwmode: htotal 2640, vtotal 1125, vdisplay 1080
[drm:drm_calc_timestamping_constants] crtc 24: clock 148500 kHz framedur 20000000 linedur 17777
[drm:drm_mode_object_reference] OBJ ID: 47 (3)
[drm:drm_mode_object_unreference] OBJ ID: 47 (4)
[drm:drm_mode_object_unreference] OBJ ID: 48 (2)
[drm:drm_mode_object_unreference] OBJ ID: 34 (4)
[drm:drm_ioctl] ret = -22
With a bit more debugging, this is what's failing:
ipu_plane_atomic_check:442: fail
[drm:drm_crtc_helper_set_config] *ERROR* failed to set mode on [CRTC:24:crtc-0]
if (old_fb && (state->src_w != old_state->src_w ||
state->src_h != old_state->src_h ||
fb->pixel_format != old_fb->pixel_format)) {
printk("%s:%d: fail\n", __func__, __LINE__);
return -EINVAL;
}
This test is stupid as it stands - it means we can _never_ change the
format or size of _any_ plane, something that the old code allowed:
- if (ipu_plane->enabled) {
- if (src_w != ipu_plane->w || src_h != ipu_plane->h ||
- fb->pixel_format != ipu_plane->base.fb->pixel_format)
- return -EINVAL;
This used to work because we'd call ipu_crtc_prepare()->ipu_fb_disable()
before the mode set, which would clear ipu_plane->enabled, causing this
test to be skipped. However, in the new code, we merely test for the
presence of the previous framebuffer, which is really not the same thing
at all.
The old functionality needs to be restored because significantly
changing the displayed mode is something which must be supported with
HDMI.
Thanks.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-08-13 10:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 7:40 [PATCH v3 00/10] imx drm atomic mode setting conversion Liu Ying
2016-07-04 7:40 ` [PATCH v3 01/10] drm/imx: ipuv3 plane: Check different types of plane separately Liu Ying
2016-07-04 7:40 ` [PATCH v3 02/10] gpu: ipu-v3: ipu-dmfc: Use static DMFC FIFO allocation mechanism Liu Ying
2016-07-04 7:40 ` [PATCH v3 03/10] drm/imx: atomic phase 1: Use transitional atomic CRTC and plane helpers Liu Ying
2016-08-13 10:11 ` Russell King - ARM Linux
2016-08-13 10:45 ` Russell King - ARM Linux [this message]
2016-08-13 11:29 ` Russell King - ARM Linux
2016-08-13 14:09 ` Russell King - ARM Linux
2016-08-13 15:00 ` Russell King - ARM Linux
2016-08-14 9:44 ` Daniel Vetter
2016-08-14 10:46 ` Daniel Vetter
2016-08-14 11:43 ` Peter Senna Tschudin
2016-08-15 6:21 ` Ying Liu
2016-07-04 7:40 ` [PATCH v3 04/10] drm/imx: atomic phase 2 step 1: Wire up state ->reset, ->duplicate and ->destroy Liu Ying
2016-07-04 7:40 ` [PATCH v3 05/10] drm/imx: atomic phase 2 step 2: Track plane_state->fb correctly in ->page_flip Liu Ying
2016-07-04 7:40 ` [PATCH v3 06/10] drm/imx: Remove encoders' ->prepare callbacks Liu Ying
2016-07-04 7:40 ` [PATCH v3 07/10] drm/imx: atomic phase 3 step 1: Use atomic configuration Liu Ying
2016-07-04 7:40 ` [PATCH v3 08/10] drm/bridge: dw-hdmi: Remove the legacy drm_connector_funcs structure Liu Ying
2016-07-04 7:40 ` [PATCH v3 09/10] drm/imx: atomic phase 3 step 2: Legacy callback fixups Liu Ying
2016-07-04 7:40 ` [PATCH v3 10/10] drm/imx: atomic phase 3 step 3: Advertise DRIVER_ATOMIC Liu Ying
2016-07-12 12:51 ` [PATCH v3 00/10] imx drm atomic mode setting conversion Daniel Vetter
2016-07-12 16:48 ` Philipp Zabel
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=20160813104531.GA4844@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gnuiyl@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox