Skip to contentSkip to conversation

R-Car DU fences support

GIT PULL Laurent Pinchart 2 participants 4 messages Feb 12, 2017 – Feb 13, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Geert,

The following changes since commit 5685cab84a6dc376a8d0e4534ae4b973546158b4:

Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm/next/base
(2017-02-12 13:18:50 +0200)

are available in the git repository at:

git://linuxtv.org/pinchartl/media.git drm/next/du

for you to fetch changes up to a194138cd82dff52d4c39895fd89dc6f26eafc97:

drm: rcar-du: Use DRM core's atomic commit helper (2017-02-12 14:15:36
+0200)

Please note that the branch is based on a merge of Dave's DRM master and the drm-misc master. Assuming that the 7 patches by Maarten get merged early enough in Dave's tree, I plan to submit a pull request for the rcar-du patches for v4.12.

----------------------------------------------------------------
Laurent Pinchart (4):
drm: rcar-du: Switch to encoder .atomic_mode_set() helper function
drm: rcar-du: Handle event when disabling CRTCs
drm: rcar-du: Clear handled event pointer in CRTC state
drm: rcar-du: Use DRM core's atomic commit helper

Maarten Lankhorst (7):
drm/atomic: Add new iterators over all state, v3. drm/atomic: Make add_affected_connectors look at crtc_state. drm/atomic: Use new atomic iterator macros.
drm/atomic: Fix atomic helpers to use the new iterator macros. drm/atomic: Add macros to access existing old/new state drm/atomic: Convert get_existing_state callers to get_old/new_state, v2. drm/blend: Use new atomic iterator macros.

Wolfram Sang (1):
drm: rcar-du: Don't open code of_device_get_match_data()

 drivers/gpu/drm/drm_atomic.c              |  39 ++--
 drivers/gpu/drm/drm_atomic_helper.c       | 377 +++++++++++++++++------------
 drivers/gpu/drm/drm_blend.c               |  23 ++-
 drivers/gpu/drm/i915/intel_display.c      |  13 +-
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c    |  13 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c     |   2 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c |   8 +-
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c |   8 +-
 drivers/gpu/drm/rcar-du/rcar_du_kms.c     |  99 +---------
 include/drm/drm_atomic.h                  | 180 +++++++++++++++++-
 include/drm/drm_atomic_helper.h           |   2 +
 11 files changed, 466 insertions(+), 298 deletions(-)
Signature · 3 lines
Regards,

Laurent Pinchart
#1 lore raw

Hi Laurent,

Quoted 5 lines · Laurent Pinchart

The following changes since commit 5685cab84a6dc376a8d0e4534ae4b973546158b4:

Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm/next/base
(2017-02-12 13:18:50 +0200)

Quoted 8 lines

are available in the git repository at:

git://linuxtv.org/pinchartl/media.git drm/next/du

for you to fetch changes up to a194138cd82dff52d4c39895fd89dc6f26eafc97:

drm: rcar-du: Use DRM core's atomic commit helper (2017-02-12 14:15:36
+0200)

Thank you, scheduled for inclusion in next renesas-drivers release (probably renesas-drivers-2017-02-21-v4.10).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw

Hi Laurent,

Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines · Laurent Pinchart

The following changes since commit 5685cab84a6dc376a8d0e4534ae4b973546158b4:

Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm/next/base
(2017-02-12 13:18:50 +0200)

are available in the git repository at:

git://linuxtv.org/pinchartl/media.git drm/next/du

Quoted 7 lines
Quoted 4 lines

for you to fetch changes up to a194138cd82dff52d4c39895fd89dc6f26eafc97:

drm: rcar-du: Use DRM core's atomic commit helper (2017-02-12 14:15:36
+0200)

Thank you, scheduled for inclusion in next renesas-drivers release (probably renesas-drivers-2017-02-21-v4.10).

Hit send too soon...

Note that it already fails to merge cleanly into today's linux-next (holding wood, rabbit ears and tails, ... for next week). My untested resolution:

drivers/gpu/drm/drm_atomic.c +0 -0
diff --cc drivers/gpu/drm/drm_atomic.c
index a5673107db26c403,428743efc031e717..0000000000000000
@@@ -1938,8 -1949,8 +1949,8 @@@ static int prepare_crtc_signaling(struc
        if (arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)
                return 0;

- for_each_crtc_in_state(state, crtc, crtc_state, i) {
+ for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
- u64 __user *fence_ptr;
+ s32 __user *fence_ptr;

                fence_ptr = get_out_fence_for_crtc(crtc_state->state, crtc);

@@@ -2018,17 -2029,14 +2029,17 @@@ static void complete_crtc_signaling(str

                return;
        }

- for_each_crtc_in_state(state, crtc, crtc_state, i) {
+ for_each_new_crtc_in_state(state, crtc, crtc_state, i) {

 +              struct drm_pending_vblank_event *event = crtc_state->event;
                /*
 -               * TEST_ONLY and PAGE_FLIP_EVENT are mutually
 -               * exclusive, if they weren't, this code should be
 -               * called on success for TEST_ONLY too.
 +               * Free the allocated event. drm_atomic_helper_setup_commit
 +               * can allocate an event too, so only free it if it's ours
 +               * to prevent a double free in drm_atomic_state_clear.
                 */
 -              if (crtc_state->event)
 -                      drm_event_cancel_free(dev, &crtc_state->event->base);
 +              if (event && (event->base.fence || event->base.file_priv)) {
 +                      drm_event_cancel_free(dev, &event->base);
 +                      crtc_state->event = NULL;
 +              }
        }

        if (!fence_state)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw

Hi Geert,

Quoted 3 lines · On Monday 13 Feb 2017 11:13:31 Geert Uytterhoeven wrote:
Quoted 2 lines · Geert Uytterhoeven
Quoted 1 line · Laurent Pinchart

The following changes since commit

5685cab84a6dc376a8d0e4534ae4b973546158b4:

Quoted 13 lines
Quoted 13 lines
Quoted 12 lines

Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm/next/base

(2017-02-12 13:18:50 +0200)

are available in the git repository at:
git://linuxtv.org/pinchartl/media.git drm/next/du

for you to fetch changes up to a194138cd82dff52d4c39895fd89dc6f26eafc97:
drm: rcar-du: Use DRM core's atomic commit helper (2017-02-12 14:15:36

+0200)

Quoted 7 lines
Quoted 2 lines

Thank you, scheduled for inclusion in next renesas-drivers release (probably renesas-drivers-2017-02-21-v4.10).

Hit send too soon...

Note that it already fails to merge cleanly into today's linux-next (holding wood, rabbit ears and tails, ... for next week).

Hardly a surprise, drm-misc evolves really fast, any patch series that touches the DRM core has a high risk of conflicting. I hope that Maarten will resubmit his patches soon and get them merged.

Quoted 1 line

My untested resolution:

Looks good to me.

Quoted 40 lines
drivers/gpu/drm/drm_atomic.c +2 -2
diff --cc drivers/gpu/drm/drm_atomic.c
index a5673107db26c403,428743efc031e717..0000000000000000
@@@ -1938,8 -1949,8 +1949,8 @@@ static int prepare_crtc_signaling(struc
        if (arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)
                return 0;
 
-       for_each_crtc_in_state(state, crtc, crtc_state, i) {
+       for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
 -              u64 __user *fence_ptr;
 +              s32 __user *fence_ptr;
 
                fence_ptr = get_out_fence_for_crtc(crtc_state->state, crtc);
@@@ -2018,17 -2029,14 +2029,17 @@@ static void complete_crtc_signaling(str
                return;
        }
 
-       for_each_crtc_in_state(state, crtc, crtc_state, i) {
+       for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
 +              struct drm_pending_vblank_event *event = crtc_state->event;
                /*
 -               * TEST_ONLY and PAGE_FLIP_EVENT are mutually
 -               * exclusive, if they weren't, this code should be
 -               * called on success for TEST_ONLY too.
 +               * Free the allocated event. drm_atomic_helper_setup_commit
 +               * can allocate an event too, so only free it if it's ours
 +               * to prevent a double free in drm_atomic_state_clear.
                 */
 -              if (crtc_state->event)
 -                      drm_event_cancel_free(dev,

&crtc_state->event->base); + if (event && (event->base.fence
|| event->base.file_priv)) { +
drm_event_cancel_free(dev, &event->base);
+ crtc_state->event = NULL;
+ }

        }

        if (!fence_state)
Signature · 3 lines
Regards,

Laurent Pinchart