Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-2017-12-21' of git://anongit.freedesktop.org…
Browse files Browse the repository at this point in the history
…/drm/drm-misc into drm-next

drm-misc-next for 4.16:

Core Changes:
- mostly doc updates and some fbdev improvements

* tag 'drm-misc-next-2017-12-21' of git://anongit.freedesktop.org/drm/drm-misc:
  drm/framebuffer: Print task that allocated the fb in debug info.
  drm/fb-helper: Add drm_fb_helper_defio_init()
  drm/fb-helper: Update DOC with new helpers
  drm/docs: Add todo entry for drm_fb_helper_fbdev_setup()
  drm/fb-helper: Add drm_fb_helper_fbdev_setup/teardown()
  drm/fb-helper: Set/clear dev->fb_helper in dummy init/fini
  drm/stm: ltdc: Remove unnecessary platform_get_resource() error check
  drm/stm: dsi: Remove unnecessary platform_get_resource() error check
  drm/doc: Move legacy kms helpers to the very end
  drm/atomic: document how to handle driver private objects
  drm/syncobj: some kerneldoc polish
  drm/print: Unconfuse kerneldoc
  drm/edid: kerneldoc for is_hdmi2_sink
  • Loading branch information
Dave Airlie committed Dec 22, 2017
2 parents df2869a + 8d44e9e commit d50ce2c
Show file tree
Hide file tree
Showing 16 changed files with 419 additions and 69 deletions.
36 changes: 18 additions & 18 deletions Documentation/gpu/drm-kms-helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@ Helper Functions Reference
.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
:export:

Legacy CRTC/Modeset Helper Functions Reference
==============================================

.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
:doc: overview

.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
:export:

Simple KMS Helper Reference
===========================

Expand Down Expand Up @@ -282,15 +273,6 @@ Flip-work Helper Reference
.. kernel-doc:: drivers/gpu/drm/drm_flip_work.c
:export:

Plane Helper Reference
======================

.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
:doc: overview

.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
:export:

Auxiliary Modeset Helpers
=========================

Expand All @@ -308,3 +290,21 @@ Framebuffer GEM Helper Reference

.. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c
:export:

Legacy Plane Helper Reference
=============================

.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
:doc: overview

.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
:export:

Legacy CRTC/Modeset Helper Functions Reference
==============================================

.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
:doc: overview

.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
:export:
14 changes: 10 additions & 4 deletions Documentation/gpu/drm-kms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,20 @@ Taken all together there's two consequences for the atomic design:

- An atomic update is assembled and validated as an entirely free-standing pile
of structures within the :c:type:`drm_atomic_state <drm_atomic_state>`
container. Again drivers can subclass that container for their own state
structure tracking needs. Only when a state is committed is it applied to the
driver and modeset objects. This way rolling back an update boils down to
releasing memory and unreferencing objects like framebuffers.
container. Driver private state structures are also tracked in the same
structure; see the next chapter. Only when a state is committed is it applied
to the driver and modeset objects. This way rolling back an update boils down
to releasing memory and unreferencing objects like framebuffers.

Read on in this chapter, and also in :ref:`drm_atomic_helper` for more detailed
coverage of specific topics.

Handling Driver Private State
-----------------------------

.. kernel-doc:: drivers/gpu/drm/drm_atomic.c
:doc: handling driver private state

Atomic Mode Setting Function Reference
--------------------------------------

Expand Down
18 changes: 18 additions & 0 deletions Documentation/gpu/todo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ drm_mode_config_helper_suspend/resume().

Contact: Maintainer of the driver you plan to convert

Convert drivers to use drm_fb_helper_fbdev_setup/teardown()
-----------------------------------------------------------

Most drivers can use drm_fb_helper_fbdev_setup() except maybe:

- amdgpu which has special logic to decide whether to call
drm_helper_disable_unused_functions()

- armada which isn't atomic and doesn't call
drm_helper_disable_unused_functions()

- i915 which calls drm_fb_helper_initial_config() in a worker

Drivers that use drm_framebuffer_remove() to clean up the fbdev framebuffer can
probably use drm_fb_helper_fbdev_teardown().

Contact: Maintainer of the driver you plan to convert

Core refactorings
=================

Expand Down
45 changes: 42 additions & 3 deletions drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ EXPORT_SYMBOL(__drm_crtc_commit_free);
* @state: atomic state
*
* Free all the memory allocated by drm_atomic_state_init.
* This is useful for drivers that subclass the atomic state.
* This should only be used by drivers which are still subclassing
* &drm_atomic_state and haven't switched to &drm_private_state yet.
*/
void drm_atomic_state_default_release(struct drm_atomic_state *state)
{
Expand All @@ -67,7 +68,8 @@ EXPORT_SYMBOL(drm_atomic_state_default_release);
* @state: atomic state
*
* Default implementation for filling in a new atomic state.
* This is useful for drivers that subclass the atomic state.
* This should only be used by drivers which are still subclassing
* &drm_atomic_state and haven't switched to &drm_private_state yet.
*/
int
drm_atomic_state_init(struct drm_device *dev, struct drm_atomic_state *state)
Expand Down Expand Up @@ -132,7 +134,8 @@ EXPORT_SYMBOL(drm_atomic_state_alloc);
* @state: atomic state
*
* Default implementation for clearing atomic state.
* This is useful for drivers that subclass the atomic state.
* This should only be used by drivers which are still subclassing
* &drm_atomic_state and haven't switched to &drm_private_state yet.
*/
void drm_atomic_state_default_clear(struct drm_atomic_state *state)
{
Expand Down Expand Up @@ -946,6 +949,42 @@ static void drm_atomic_plane_print_state(struct drm_printer *p,
plane->funcs->atomic_print_state(p, state);
}

/**
* DOC: handling driver private state
*
* Very often the DRM objects exposed to userspace in the atomic modeset api
* (&drm_connector, &drm_crtc and &drm_plane) do not map neatly to the
* underlying hardware. Especially for any kind of shared resources (e.g. shared
* clocks, scaler units, bandwidth and fifo limits shared among a group of
* planes or CRTCs, and so on) it makes sense to model these as independent
* objects. Drivers then need to do similar state tracking and commit ordering for
* such private (since not exposed to userpace) objects as the atomic core and
* helpers already provide for connectors, planes and CRTCs.
*
* To make this easier on drivers the atomic core provides some support to track
* driver private state objects using struct &drm_private_obj, with the
* associated state struct &drm_private_state.
*
* Similar to userspace-exposed objects, private state structures can be
* acquired by calling drm_atomic_get_private_obj_state(). Since this function
* does not take care of locking, drivers should wrap it for each type of
* private state object they have with the required call to drm_modeset_lock()
* for the corresponding &drm_modeset_lock.
*
* All private state structures contained in a &drm_atomic_state update can be
* iterated using for_each_oldnew_private_obj_in_state(),
* for_each_new_private_obj_in_state() and for_each_old_private_obj_in_state().
* Drivers are recommended to wrap these for each type of driver private state
* object they have, filtering on &drm_private_obj.funcs using for_each_if(), at
* least if they want to iterate over all objects of a given type.
*
* An earlier way to handle driver private state was by subclassing struct
* &drm_atomic_state. But since that encourages non-standard ways to implement
* the check/commit split atomic requires (by using e.g. "check and rollback or
* commit instead" of "duplicate state, check, then either commit or release
* duplicated state) it is deprecated in favour of using &drm_private_state.
*/

/**
* drm_atomic_private_obj_init - initialize private object
* @obj: private object
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -4871,6 +4871,11 @@ EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
* @mode: DRM display mode
* @rgb_quant_range: RGB quantization range (Q)
* @rgb_quant_range_selectable: Sink support selectable RGB quantization range (QS)
* @is_hdmi2_sink: HDMI 2.0 sink, which has different default recommendations
*
* Note that @is_hdmi2_sink can be derived by looking at the
* &drm_scdc.supported flag stored in &drm_hdmi_info.scdc,
* &drm_display_info.hdmi, which can be found in &drm_connector.display_info.
*/
void
drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
Expand Down
Loading

0 comments on commit d50ce2c

Please sign in to comment.