linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [DPU PATCH v2 00/12] Refactor DPU device/driver hierarchy and add runtime_pm support
@ 2018-05-11 14:49 Rajesh Yadav
  2018-05-11 14:49 ` [DPU PATCH v2 02/12] drm/msm/mdp5: subclass msm_mdss for mdp5 Rajesh Yadav
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Rajesh Yadav @ 2018-05-11 14:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
  Cc: robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw, Rajesh Yadav,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw

SoCs containing mdp5 or dpu have a MDSS top level wrapper which includes
sub-blocks as mdp5/dpu, dsi, dp, hdmi etc. The MDSS top level wrapper
manages common resources like common clocks, main power supply and
interrupts for its sub-blocks.

But current dpu driver implementation is based on a flat device hierarchy
where MDSS/DPU HW blocks were represented by single device and DSI/DP etc.
are represented as independent devices w/o any relationships b/t these
nodes which doesn't model the HW associations precisely.

A minimal MDSS and DPU controller device separation is done in following
patch series [1] but currently both these devices match to a single driver
which is getting probed two times and all the resources are still tied to
DPU device.

Moreover, all the power resource management in DPU driver is part of
power_handle module which manages these resources via a custom
implementation.

Irq domain handling is part of DPU device, due to lack of a dedicated
driver for MDSS top level wrapper device.

This patch series aims at adding separate drivers for MDSS top level
wrapper device and DPU child device. MDP5 device/driver is used as a
reference for this refactoring effort. Both the drivers implement
runtime_pm support for their power resource management. Child nodes can
control common resources managed by parent device due to parent child
relationship defined in dt. The top level MDSS device acts as an
interrupt controller and manages hwirq mappings for its child devices. 

Inorder to add MDP5 and DPU specific MDSS driver implementation, this patch
series also subclasses existing msm_mdss define. A helper interface
(msm_mdss_funcs) is added to invoke the platform specific implementations.

This change also corrects hw catalog offsets for all sub blocks present
within DPU device. The offset are now defined wrt DPU base address
(instead of using MDSS base address).

Clock and Power handling code have been removed from dpu_power_handle since
each device manages it's resources via runtime_pm. Now, since
dpu_power_handle manages only bus scaling and power enable/disable
notifications and it's usage is restricted to DPU driver only, moved
dpu_power_handle code to DPU folder.

The dt bindings update patch will be sent subsequently.

This patch series depends on [1].

1 - https://lists.freedesktop.org/archives/freedreno/2018-April/002354.html

Changes in v2:
	- fix indentation issues in dpu_mdss (Sean Paul)
	- merge tiny static functions (like _dpu_mdss_hw_rev_init()
	  and _dpu_mdss_get_intr_sources()) in caller functions (Sean Paul)
	- remove unnecessary goto statements from dpu_mdss_irq (Sean Paul)
	- remove redundant input param checks from dpu_mdss
	  and dpu_kms (Sean Paul/Jordan Crouse)
	- return error code from dpu_mdss_enable/disable (Sean Paul/Jordan Crouse)
	- remove explicit calls to devm_kfree (Sean Paul/Jordan Crouse)
	- remove compatibility check from dpu_mdss_init as
	  it is conditionally called from msm_drv (Sean Paul)
	- reworked msm_dss_parse_clock() to add return checks for
	  of_property_read_* calls, fix log message and
	  fix alignment issues (Sean Paul/Jordan Crouse)
	- remove redundant param checks from __intr_offset and
	  make it a void function to avoid unnecessary error
	  handling from caller (Jordan Crouse)
	- use %pK for kernel pointers (Jordan Crouse)
	- don't export msm_dss_parse_clock since it is used
	  only by dpu driver (Jordan Crouse)
	- merge dpu_init into dpu_bind and dpu_destroy into dpu_unbind (Sean Paul)
	- remove explicit devm allocation failure message (Jordan Crouse)
	- remove local variable to hold and return error code
	  in _dpu_core_perf_set_core_clk_rate() instead return
	  retcode directly from msm_dss_clk_set_rate() call (Sean Paul)
	- return &mp->clk_config[i] directly to avoid local variable
	  in _dpu_kms_get_clk() (Sean Paul)
	- invert conditional check to eliminate local rate variable
	  from dpu_kms_get_clk_rate() (Sean Paul)
	- remove end label from dpu_power_resource_init() and return
	  directly on dpu_power_parse_dt_supply() failure as no cleanup
	  is needed (Sean Paul)
	- remove checks for vtotal and vrefresh from
 	  dpu_encoder_phys_cmd_tearcheck_config() as they should be
	  valid in mode_set() call (Sean Paul)
	- add error handling in dpu_core_perf_crtc_update() (Sean Paul)

Rajesh Yadav (12):
  drm/msm: remove pm_runtime_enable call from msm_drv
  drm/msm/mdp5: subclass msm_mdss for mdp5
  drm/msm/dpu: add MDSS top level driver for dpu
  drm/msm/dpu: create new platform driver for dpu device
  drm/msm/dpu: update dpu sub-block offsets wrt dpu base address
  drm/msm/dpu: use runtime_pm calls on dpu device
  drm/msm/dpu: remove clock management code from dpu_power_handle
  drm/msm/dpu: remove power management code from dpu_power_handle
  drm/msm/dp: remove dpu_power_handle calls from dp driver
  drm/msm/dpu: use runtime_pm calls in dpu_dbg
  drm/msm/dpu: move dpu_power_handle to dpu folder
  drm/msm/dpu: add error handling in dpu_core_perf_crtc_update

 drivers/gpu/drm/msm/Makefile                       |    3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c       |  106 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h       |   14 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c      |   82 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h      |   15 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |   19 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h           |    2 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   17 +-
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c   |    9 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c     |   77 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h     |    7 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c  |   46 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h  |   11 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_irq.c            |   48 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c            |  337 ++++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h            |   16 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c           |  254 +++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |    6 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c   |  693 +++++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h   |  288 ++++++
 drivers/gpu/drm/msm/disp/mdp5/mdp5_mdss.c          |  154 +--
 drivers/gpu/drm/msm/dp/dp_power.c                  |   32 +-
 drivers/gpu/drm/msm/dp/dp_power.h                  |    4 +-
 drivers/gpu/drm/msm/dpu_dbg.c                      |   18 +-
 drivers/gpu/drm/msm/dpu_dbg.h                      |   13 +-
 drivers/gpu/drm/msm/dpu_io_util.c                  |   57 ++
 drivers/gpu/drm/msm/dpu_power_handle.c             | 1075 --------------------
 drivers/gpu/drm/msm/dpu_power_handle.h             |  330 ------
 drivers/gpu/drm/msm/msm_drv.c                      |   86 +-
 drivers/gpu/drm/msm/msm_drv.h                      |   10 +-
 drivers/gpu/drm/msm/msm_kms.h                      |   21 +-
 include/linux/dpu_io_util.h                        |    2 +
 32 files changed, 1818 insertions(+), 2034 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
 delete mode 100644 drivers/gpu/drm/msm/dpu_power_handle.c
 delete mode 100644 drivers/gpu/drm/msm/dpu_power_handle.h

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-05-14 14:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11 14:49 [DPU PATCH v2 00/12] Refactor DPU device/driver hierarchy and add runtime_pm support Rajesh Yadav
2018-05-11 14:49 ` [DPU PATCH v2 02/12] drm/msm/mdp5: subclass msm_mdss for mdp5 Rajesh Yadav
     [not found] ` <1526050178-31893-1-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-11 14:49   ` [DPU PATCH v2 01/12] drm/msm: remove redundant pm_runtime_enable call from msm_drv Rajesh Yadav
2018-05-11 14:49   ` [DPU PATCH v2 03/12] drm/msm/dpu: add MDSS top level driver for dpu Rajesh Yadav
2018-05-11 15:28     ` Sean Paul
2018-05-14 14:06       ` ryadav
     [not found]     ` <1526050178-31893-4-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-11 17:05       ` Jordan Crouse
     [not found]         ` <20180511170523.GF4995-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-05-11 18:32           ` Sean Paul
2018-05-11 14:49   ` [DPU PATCH v2 04/12] drm/msm/dpu: create new platform driver for dpu device Rajesh Yadav
     [not found]     ` <1526050178-31893-5-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-11 15:30       ` Sean Paul
2018-05-11 17:06       ` Jordan Crouse
2018-05-11 14:49   ` [DPU PATCH v2 06/12] drm/msm/dpu: use runtime_pm calls on " Rajesh Yadav
2018-05-11 14:49   ` [DPU PATCH v2 07/12] drm/msm/dpu: remove clock management code from dpu_power_handle Rajesh Yadav
     [not found]     ` <1526050178-31893-8-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-11 15:35       ` Sean Paul
2018-05-11 14:49   ` [DPU PATCH v2 08/12] drm/msm/dpu: remove power " Rajesh Yadav
     [not found]     ` <1526050178-31893-9-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-11 15:40       ` Sean Paul
2018-05-11 14:49   ` [DPU PATCH v2 09/12] drm/msm/dp: remove dpu_power_handle calls from dp driver Rajesh Yadav
2018-05-11 14:49   ` [DPU PATCH v2 10/12] drm/msm/dpu: use runtime_pm calls in dpu_dbg Rajesh Yadav
     [not found]     ` <1526050178-31893-11-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-11 15:47       ` Sean Paul
2018-05-11 14:49   ` [DPU PATCH v2 11/12] drm/msm/dpu: move dpu_power_handle to dpu folder Rajesh Yadav
     [not found]     ` <1526050178-31893-12-git-send-email-ryadav-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-11 15:48       ` Sean Paul
2018-05-11 14:49   ` [DPU PATCH v2 12/12] drm/msm/dpu: add error handling in dpu_core_perf_crtc_update Rajesh Yadav
2018-05-11 15:49     ` Sean Paul
2018-05-11 14:49 ` [DPU PATCH v2 05/12] drm/msm/dpu: update dpu sub-block offsets wrt dpu base address Rajesh Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).