09 Apr, 2020

1 commit

  • drm_fbdev_generic_setup() was changed to be a void return, but the stub
    was left returning 0.

    ./include/drm/drm_fb_helper.h: In function ‘drm_fbdev_generic_setup’:
    ./include/drm/drm_fb_helper.h:450:9: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
    ./include/drm/drm_fb_helper.h:448:1: note: declared here
    448 | drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)

    Fixes: 1aed9509b29a ("drm/fb-helper: Remove return value from drm_fbdev_generic_setup()")
    Signed-off-by: Chris Wilson
    Cc: Thomas Zimmermann
    Cc: Sam Ravnborg
    Reviewed-by: Alex Deucher
    Link: https://patchwork.freedesktop.org/patch/msgid/20200408212407.4309-1-chris@chris-wilson.co.uk

    Chris Wilson
     

08 Apr, 2020

1 commit

  • Generic fbdev emulation is a DRM client. Drivers should invoke the
    setup function, but not depend on its success. Hence remove the return
    value.

    v3:
    * document stricter requirements for call sequence
    v2:
    * warn if fbdev device has not been registered yet
    * document the new behavior
    * convert the existing warning to the new dev_ interface

    Signed-off-by: Thomas Zimmermann
    Reviewed-by: Sam Ravnborg
    Reviewed-by: Noralf Trønnes
    Acked-by: Sam Ravnborg
    Acked-by: Gerd Hoffmann
    Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-11-tzimmermann@suse.de

    Thomas Zimmermann
     

06 Mar, 2020

2 commits

  • drm_fb_helper_single_add_all_connectors(),
    drm_fb_helper_add_one_connector()
    and drm_fb_helper_remove_one_connector() don't keep an array of
    connectors anymore and are just dummy. Now we have no callers to these
    functions hence remove them.

    Signed-off-by: Pankaj Bharadiya
    Reviewed-by: Laurent Pinchart
    Reviewed-by: Emil Velikov
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20200305120434.111091-7-pankaj.laxminarayan.bharadiya@intel.com

    Pankaj Bharadiya
     
  • The max connector argument for drm_fb_helper_init() isn't used anymore
    hence remove it.

    All the drm_fb_helper_init() calls are modified with below sementic
    patch.

    @@
    expression E1, E2, E3;
    @@
    - drm_fb_helper_init(E1,E2, E3)
    + drm_fb_helper_init(E1,E2)

    Signed-off-by: Pankaj Bharadiya
    Reviewed-by: Emil Velikov
    Reviewed-by: Thomas Zimmermann
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20200305120434.111091-2-pankaj.laxminarayan.bharadiya@intel.com

    Pankaj Bharadiya
     

19 Nov, 2019

1 commit


13 Nov, 2019

1 commit

  • Not sure we don't yet have this as a patch somewhere ...

    Motivation is that the automatic lifetime management of the generic fbdev
    code is quite tricky, and it'll get even more tricky. Allowing drivers
    to just use the fb_probe looks like a recipe for disaster.

    Cc: Gerd Hoffmann
    Cc: Noralf Trønnes
    Cc: Thomas Zimmermann
    Reviewed-by: Noralf Trønnes
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20191112175048.1581-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

07 Nov, 2019

1 commit


28 Oct, 2019

1 commit

  • There are no users of drm_fb_helper_defio_init(), so we can remove
    it. The documentation around defio support is a bit misleading and
    should mention compatibility issues with SHMEM helpers. Clarify this.

    Signed-off-by: Thomas Zimmermann
    Reviewed-by: Noralf Trønnes
    Link: https://patchwork.freedesktop.org/patch/msgid/20191025092759.13069-2-tzimmermann@suse.de

    Thomas Zimmermann
     

23 Aug, 2019

2 commits


11 Jun, 2019

2 commits

  • This prepares the modeset code so it can be moved out as-is in the next
    patch.

    v3: Remove stray newline

    Signed-off-by: Noralf Trønnes
    Reviewed-by: Maxime Ripard
    Reviewed-by: Sam Ravnborg
    Link: https://patchwork.freedesktop.org/patch/msgid/20190608152657.36613-3-noralf@tronnes.org

    Noralf Trønnes
     
  • All drivers add all their connectors so there's no need to keep around an
    array of available connectors. Instead we just put the useable (not
    writeback) connectors in a temporary array using
    drm_client_for_each_connector_iter() everytime we probe the outputs.
    Other places where it's necessary to look at the connectors, we just
    iterate over them using the same iterator function.

    Rename functions which signature is changed since they will be moved to
    drm_client in a later patch.

    v6: Improve commit message (Sam Ravnborg)

    Signed-off-by: Noralf Trønnes
    Reviewed-by: Sam Ravnborg
    Link: https://patchwork.freedesktop.org/patch/msgid/20190608152657.36613-2-noralf@tronnes.org

    Noralf Trønnes
     

04 Jun, 2019

1 commit

  • struct drm_fb_helper_crtc is now just a wrapper around drm_mode_set so
    use that directly instead and attach it as a modeset array onto
    drm_client_dev. drm_fb_helper will use this array to store its modesets
    which means it will always initialize a drm_client, but it will not
    register the client (callbacks) unless it's the generic fbdev emulation.

    Code will later be moved to drm_client, so add code there in a new file
    drm_client_modeset.c with MIT license to match drm_fb_helper.c.

    The modeset connector array size is hardcoded for the cloned case to avoid
    having to pass in a value from the driver. A value of 8 is chosen to err
    on the safe side. This means that the max connector argument for
    drm_fb_helper_init() and drm_fb_helper_fbdev_setup() isn't used anymore,
    a todo entry for this is added.

    In pan_display_atomic() restore_fbdev_mode_force() is used instead of
    restore_fbdev_mode_atomic() because that one will later become internal
    to drm_client_modeset.

    Locking order:
    1. drm_fb_helper->lock
    2. drm_master_internal_acquire
    3. drm_client_dev->modeset_mutex

    v6: Improve commit message (Sam Ravnborg)

    v3:
    - Use full drm_client_init/release for the modesets (Daniel Vetter)
    - drm_client_for_each_modeset: use lockdep_assert_held (Daniel Vetter)
    - Hook up to Documentation/gpu/drm-client.rst (Daniel Vetter)

    v2:
    - Add modesets array to drm_client (Daniel Vetter)
    - Use a new file for the modeset code (Daniel Vetter)
    - File has to be MIT licensed (Emmanuel Vadot)
    - Add copyrights from drm_fb_helper.c

    Signed-off-by: Noralf Trønnes
    Reviewed-by: Sam Ravnborg
    Link: https://patchwork.freedesktop.org/patch/msgid/20190531140117.37751-3-noralf@tronnes.org

    Noralf Trønnes
     

14 May, 2019

2 commits


11 Apr, 2019

1 commit

  • It is generic code and having it in the helper will let other drivers
    benefit from it.

    One change was necessary assuming this to be true:
    INTEL_INFO(dev_priv)->num_pipes == dev->mode_config.num_crtc

    Suggested-by: Daniel Vetter
    Cc: Jani Nikula
    Cc: Joonas Lahtinen
    Cc: Rodrigo Vivi
    Cc: intel-gfx@lists.freedesktop.org
    Signed-off-by: Noralf Trønnes
    Reviewed-by: Jani Nikula
    Link: https://patchwork.freedesktop.org/patch/msgid/20190407165243.54043-4-noralf@tronnes.org

    Noralf Trønnes
     

29 Mar, 2019

1 commit

  • drm-misc-next for 5.2:

    UAPI Changes:
    - Remove unused DRM_DISPLAY_INFO_LEN (Ville)

    Cross-subsystem Changes:
    - None

    Core Changes:
    - Fix compilation when CONFIG_FBDEV not selected (Daniel)
    - fbdev: Make skip_vt_switch default (Daniel)
    - Merge fb_helper_fill_fix, fb_helper_fill_var into fb_helper_fill_info (Daniel)
    - Remove unused fields in connector, display_info, and edid_quirks (Ville)

    Driver Changes:
    - virtio: package function args in virtio_gpu_object_params (Gerd)
    - vkms: Fix potential NULL-dereference bug (Kangjie)

    Signed-off-by: Dave Airlie

    From: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/msgid/20190328183045.GA44823@art_vandelay

    Dave Airlie
     

28 Mar, 2019

1 commit

  • I forgot the !CONFIG_FBDEV case. Also some kerneldoc needed more
    adjusting.

    Cc: Noralf Trønnes
    Cc: Alex Deucher
    Reported-by: kbuild test robot
    Reviewed-by: Noralf Trønnes
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20190327125819.16478-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

27 Mar, 2019

2 commits

  • Not used by drivers anymore.

    v2: Rebase

    Reviewed-by: Noralf Trønnes
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-21-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • The fbdev split between fix and var information is kinda
    pointless for drm drivers since everything is fixed: The fbdev
    emulation doesn't support changing modes at all.

    Create a new simplified helper and use it in the generic fbdev
    helper code. Follow-up patches will beef it up more and roll
    it out to all drivers.

    v2: We need to keep sizes, since they might not match the fb dimensions
    (Noralf)

    v3: Fix typo in commit message and remove extraneous line in kerneldoc (Noralf)

    Reviewed-by: Noralf Trønnes
    Reviewed-by: Alex Deucher
    Cc: Noralf Trønnes
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

07 Mar, 2019

1 commit


08 Sep, 2018

1 commit


04 Sep, 2018

1 commit

  • Almost all PCI drivers using remove_conflicting_framebuffers() wrap it
    with the same code.

    v2: add kerneldoc for DRM helper
    v3: propagate remove_conflicting_framebuffers() return value
    + move kerneldoc to where function is implemented

    Signed-off-by: Michał Mirosław
    Acked-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/7db1c278276de420eb45a1b71d06b5eb6bbd49ef.1535810304.git.mirq-linux@rere.qmqm.pl

    Michał Mirosław
     

10 Jul, 2018

2 commits


20 Dec, 2017

3 commits

  • Add helper for initializing fbdev deferred I/O.

    The cleanup could have happened in drm_fb_helper_fini(), but that would
    have required me to set fb_info->fbdefio to NULL in a couple of drivers
    before they call _fini() to avoid double defio cleanup. The problem is
    that one of those is vboxvideo which lives in Greg's staging tree.
    So I put the cleanup in drm_fb_helper_fbdev_teardown(), not perfect
    but not that bad either.

    Signed-off-by: Noralf Trønnes
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20171215175119.36181-6-noralf@tronnes.org

    Noralf Trønnes
     
  • Add helpers to setup and teardown fbdev emulation.

    Signed-off-by: Noralf Trønnes
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20171215175119.36181-3-noralf@tronnes.org

    Noralf Trønnes
     
  • Set dev->fb_helper even when fbdev emulation is compiled out,
    so drivers can use it to free the structure.
    Clear it for consistency.

    Fixes: 29ad20b22c8f ("drm: Add drm_device->fb_helper pointer")
    Signed-off-by: Noralf Trønnes
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20171215175119.36181-2-noralf@tronnes.org

    Noralf Trønnes
     

05 Dec, 2017

1 commit

  • Apply the "panel orientation" drm connector prop to the primary plane so
    that fbcon and fbdev using userspace programs display the right way up.

    Changes in v3:
    -Use a rotation member in struct drm_fb_helper_crtc and set that from
    drm_setup_crtcs instead of looping over all crtc's to find the right one
    later
    -Since we now no longer look at rotation quirks directly in the fbcon
    code, set fb_info.fbcon_rotate_hint when the panel is not mounted upright
    and we cannot use hardware rotation

    Changes in v4:
    -Make drm_fb_helper_init() init drm_fb_helper_crtc.rotation to
    DRM_MODE_ROTATE_0 for all crtcs, so that we do not end up setting the
    plane_state's rotation to an invalid value for disabled crtcs
    (caught by Fi.CI)

    Changes in v5:
    -Only use hardware (crtc primary plane) rotation for DRM_ROTATE_180,
    90 / 270 degree rotation requires special handling which we lack atm
    -Add a TODO comment for 90 / 270 degree hardware rotation
    -Add some comments to better document the default case when mapping
    sw_rotations to fbcon_rotate_hints

    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94894
    Reviewed-by: Daniel Vetter
    Signed-off-by: Hans de Goede
    Link: https://patchwork.freedesktop.org/patch/msgid/20171125193553.23986-5-hdegoede@redhat.com

    Hans de Goede
     

01 Nov, 2017

1 commit


07 Aug, 2017

1 commit

  • Drivers no longer have any need for these callbacks, and there are no
    users. Zap. Zap-zap-zzzap-p-pp-p.

    Acked-by: Daniel Vetter
    Signed-off-by: Peter Rosin
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20170713162538.22788-15-peda@axentia.se

    Peter Rosin
     

26 Jul, 2017

1 commit

  • FB helper code falls back to a 1024x768 mode if no outputs are connected
    or don't report back any modes upon initialization. This can be annoying
    because outputs that are added to FB helper later on can't be used with
    FB helper if they don't support a matching mode.

    The fallback is in place because VGA connectors can happen to report an
    unknown connection status even when they are in fact connected.

    Some drivers have custom solutions in place to defer FB helper setup
    until at least one output is connected. But the logic behind these
    solutions is always the same and there is nothing driver-specific about
    it, so a better alterative is to fix the FB helper core and add support
    for all drivers automatically.

    This patch adds support for deferred FB helper setup. It checks all the
    connectors for their connection status, and if all of them report to be
    disconnected marks the FB helper as needing deferred setup. Whet setup
    is deferred, the FB helper core will automatically retry setup after a
    hotplug event, and it will keep trying until it succeeds.

    v2: Rebase onto my entirely reworked fbdev helper locking. One big
    difference is that this version again drops&reacquires the fbdev lock
    (which is now fb_helper->lock, but before this patch series it was
    mode_config->mutex), because register_framebuffer must be able to
    recurse back into fbdev helper code for the initial screen setup.

    v3: __drm_fb_helper_initial_config must hold fb_helper->lock upon
    return, I've fumbled that in the deferred setup case (Liviu).

    v4: I was blind, redo this all. __drm_fb_helper_initial_config
    shouldn't need to reacquire fb_helper->lock, that just confuses
    callers. I myself got confused by kernel_fb_helper_lock and somehow
    thought it's the same as fb_helper->lock. Tsk.

    Also simplify the logic a bit (we don't need two functions to probe
    connectors), we can stick much closer to the existing code. And update
    some comments I've spotted that are outdated.

    v5: Don't pass -EAGAIN to drivers, it's just an internal error code
    (Liviu).

    v6: Add _and_unlock suffix to clarify locking (Maarten)

    Cc: Liviu Dudau
    Cc: John Stultz
    Cc: Thierry Reding
    Cc: Maarten Lankhorst
    Tested-by: John Stultz
    Signed-off-by: Thierry Reding (v1)
    Reviewed-by: Maarten Lankhorst
    Reviewed-by: Liviu Dudau
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20170706130023.28417-3-daniel.vetter@ffwll.ch
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

06 Jul, 2017

1 commit

  • Introduce a new top-level lock for the FB helper code. This will allow
    better locking granularity and avoid the need to abuse modeset locking
    for this purpose instead.

    This patch just adds the new lock everywhere we currently grab
    mode_config->mutex (explicitly, or through drm_modeset_lock_all).
    Follow-up patches will push the kms locking down into only the places
    that need it.

    v2:
    - use lockdep_assert_held
    - use drm_fb_helper_for_each_connector where possible
    - use the new top-level lock consistently, i.e. in all the places
    we're currently acquiring mode_config.mutex.
    - small polish to the kerneldoc

    Tested-by: John Stultz
    Signed-off-by: Thierry Reding (v1)
    Reviewed-by: Maarten Lankhorst
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170704151833.17304-4-daniel.vetter@ffwll.ch

    Thierry Reding
     

02 Mar, 2017

1 commit

  • Implement legacy framebuffer ioctl FBIO_WAITFORVSYNC in the generic
    framebuffer emulation driver. Legacy framebuffer users like non kms/drm
    based OpenGL(ES)/EGL implementations may require the ioctl to
    synchronize drawing or buffer flip for double buffering. It is tested on
    the i.MX6.

    Signed-off-by: Maxime Ripard
    Tested-by: Neil Armstrong
    Signed-off-by: Daniel Vetter

    Maxime Ripard
     

08 Feb, 2017

1 commit

  • Noticed that everyone duplicates the same logic here and we could safe
    a few lines per driver. Yay for lots of drivers to make such tiny
    refactors worth-while!

    v2: Forgot to git add everything :(

    v3: Actually remove release_fbi (Sean, Emil, Chris) ...

    Cc: Chris Wilson
    Cc: Sean Paul
    Cc: Noralf Trønnes
    Cc: Emil Velikov
    Reviewed-by: Sean Paul
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170207161603.17611-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

03 Feb, 2017

2 commits

  • Commit be7f735cd5ea ("drm: Rely on mode_config data for fb_helper
    initialization") broke the build when CONFIG_DRM_FBDEV_EMULATION is
    disabled because it didn't update the prototype for drm_fb_helper_init
    in that case.

    Fixes: be7f735cd5ea ("drm: Rely on mode_config data for fb_helper
    initialization")
    Signed-off-by: Gabriel Krisman Bertazi
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170202193900.22075-1-krisman@collabora.co.uk

    Gabriel Krisman Bertazi
     
  • Instead of receiving the num_crts as a parameter, we can read it
    directly from the mode_config structure. I audited the drivers that
    invoke this helper and I believe all of them initialize the mode_config
    struct accordingly, prior to calling the fb_helper.

    I used the following coccinelle hack to make this transformation, except
    for the function headers and comment updates. The first and second
    rules are split because I couldn't find a way to remove the unused
    temporary variables at the same time I removed the parameter.

    //
    @r@
    expression A,B,D,E;
    identifier C;
    @@
    (
    - drm_fb_helper_init(A,B,C,D)
    + drm_fb_helper_init(A,B,D)
    |
    - drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
    + drm_fbdev_cma_init_with_funcs(A,B,D,E)
    |
    - drm_fbdev_cma_init(A,B,C,D)
    + drm_fbdev_cma_init(A,B,D)
    )

    @@
    expression A,B,C,D,E;
    @@
    (
    - drm_fb_helper_init(A,B,C,D)
    + drm_fb_helper_init(A,B,D)
    |
    - drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
    + drm_fbdev_cma_init_with_funcs(A,B,D,E)
    |
    - drm_fbdev_cma_init(A,B,C,D)
    + drm_fbdev_cma_init(A,B,D)
    )

    @@
    identifier r.C;
    type T;
    expression V;
    @@
    - T C;

    //

    Changes since v1:
    - Rebased on top of the tip of drm-misc-next.
    - Remove mention to sti since a proper fix got merged.

    Suggested-by: Daniel Vetter
    Signed-off-by: Gabriel Krisman Bertazi
    Reviewed-by: Eric Anholt
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170202162640.27261-1-krisman@collabora.co.uk

    Gabriel Krisman Bertazi
     

09 Jan, 2017

1 commit


30 Dec, 2016

1 commit

  • sed -e 's/\( \* .*\)struct &\([_a-z]*\)/\1\&struct \2/' -i

    Originally I wasnt a friend of this style because I thought a
    line-break between the "&struct" and "foo" part would break it. But a
    quick test shows that " * &struct \n * foo\n" works pefectly well with
    current kernel-doc. So time to mass-apply these changes!

    Cc: Jani Nikula
    Cc: Chris Wilson
    Reviewed-by: David Herrmann
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1483044517-5770-6-git-send-email-daniel.vetter@ffwll.ch

    Daniel Vetter
     

14 Nov, 2016

1 commit