Skip to content

Commit e906d7b

Browse files
committed
Merge branch 'drm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
Merge the MSM driver from Rob Clark * 'drm-next' of git://people.freedesktop.org/~robclark/linux: drm/msm: add basic hangcheck/recovery mechanism drm/msm: add a3xx gpu support drm/msm: add register definitions for gpu drm/msm: basic KMS driver for snapdragon drm/msm: add register definitions
2 parents acb4652 + bd6f82d commit e906d7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+14844
-0
lines changed

drivers/gpu/drm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,5 @@ source "drivers/gpu/drm/omapdrm/Kconfig"
223223
source "drivers/gpu/drm/tilcdc/Kconfig"
224224

225225
source "drivers/gpu/drm/qxl/Kconfig"
226+
227+
source "drivers/gpu/drm/msm/Kconfig"

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
5454
obj-$(CONFIG_DRM_OMAP) += omapdrm/
5555
obj-$(CONFIG_DRM_TILCDC) += tilcdc/
5656
obj-$(CONFIG_DRM_QXL) += qxl/
57+
obj-$(CONFIG_DRM_MSM) += msm/
5758
obj-y += i2c/

drivers/gpu/drm/msm/Kconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
config DRM_MSM
3+
tristate "MSM DRM"
4+
depends on DRM
5+
depends on ARCH_MSM
6+
depends on ARCH_MSM8960
7+
select DRM_KMS_HELPER
8+
select SHMEM
9+
select TMPFS
10+
default y
11+
help
12+
DRM/KMS driver for MSM/snapdragon.
13+
14+
config DRM_MSM_FBDEV
15+
bool "Enable legacy fbdev support for MSM modesetting driver"
16+
depends on DRM_MSM
17+
select FB_SYS_FILLRECT
18+
select FB_SYS_COPYAREA
19+
select FB_SYS_IMAGEBLIT
20+
select FB_SYS_FOPS
21+
default y
22+
help
23+
Choose this option if you have a need for the legacy fbdev
24+
support. Note that this support also provide the linux console
25+
support on top of the MSM modesetting driver.
26+
27+
config DRM_MSM_REGISTER_LOGGING
28+
bool "MSM DRM register logging"
29+
depends on DRM_MSM
30+
default n
31+
help
32+
Compile in support for logging register reads/writes in a format
33+
that can be parsed by envytools demsm tool. If enabled, register
34+
logging can be switched on via msm.reglog=y module param.

drivers/gpu/drm/msm/Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm
2+
ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
3+
ccflags-y += -Werror
4+
endif
5+
6+
msm-y := \
7+
adreno/adreno_gpu.o \
8+
adreno/a3xx_gpu.o \
9+
hdmi/hdmi.o \
10+
hdmi/hdmi_connector.o \
11+
hdmi/hdmi_i2c.o \
12+
hdmi/hdmi_phy_8960.o \
13+
hdmi/hdmi_phy_8x60.o \
14+
mdp4/mdp4_crtc.o \
15+
mdp4/mdp4_dtv_encoder.o \
16+
mdp4/mdp4_format.o \
17+
mdp4/mdp4_irq.o \
18+
mdp4/mdp4_kms.o \
19+
mdp4/mdp4_plane.o \
20+
msm_connector.o \
21+
msm_drv.o \
22+
msm_fb.o \
23+
msm_gem.o \
24+
msm_gem_submit.o \
25+
msm_gpu.o \
26+
msm_ringbuffer.o
27+
28+
msm-$(CONFIG_DRM_MSM_FBDEV) += msm_fbdev.o
29+
30+
obj-$(CONFIG_DRM_MSM) += msm.o

drivers/gpu/drm/msm/NOTES

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
NOTES about msm drm/kms driver:
2+
3+
In the current snapdragon SoC's, we have (at least) 3 different
4+
display controller blocks at play:
5+
+ MDP3 - ?? seems to be what is on geeksphone peak device
6+
+ MDP4 - S3 (APQ8060, touchpad), S4-pro (APQ8064, nexus4 & ifc6410)
7+
+ MDSS - snapdragon 800
8+
9+
(I don't have a completely clear picture on which display controller
10+
maps to which part #)
11+
12+
Plus a handful of blocks around them for HDMI/DSI/etc output.
13+
14+
And on gpu side of things:
15+
+ zero, one, or two 2d cores (z180)
16+
+ and either a2xx or a3xx 3d core.
17+
18+
But, HDMI/DSI/etc blocks seem like they can be shared across multiple
19+
display controller blocks. And I for sure don't want to have to deal
20+
with N different kms devices from xf86-video-freedreno. Plus, it
21+
seems like we can do some clever tricks like use GPU to trigger
22+
pageflip after rendering completes (ie. have the kms/crtc code build
23+
up gpu cmdstream to update scanout and write FLUSH register after).
24+
25+
So, the approach is one drm driver, with some modularity. Different
26+
'struct msm_kms' implementations, depending on display controller.
27+
And one or more 'struct msm_gpu' for the various different gpu sub-
28+
modules.
29+
30+
(Second part is not implemented yet. So far this is just basic KMS
31+
driver, and not exposing any custom ioctls to userspace for now.)
32+
33+
The kms module provides the plane, crtc, and encoder objects, and
34+
loads whatever connectors are appropriate.
35+
36+
For MDP4, the mapping is:
37+
38+
plane -> PIPE{RGBn,VGn} \
39+
crtc -> OVLP{n} + DMA{P,S,E} (??) |-> MDP "device"
40+
encoder -> DTV/LCDC/DSI (within MDP4) /
41+
connector -> HDMI/DSI/etc --> other device(s)
42+
43+
Since the irq's that drm core mostly cares about are vblank/framedone,
44+
we'll let msm_mdp4_kms provide the irq install/uninstall/etc functions
45+
and treat the MDP4 block's irq as "the" irq. Even though the connectors
46+
may have their own irqs which they install themselves. For this reason
47+
the display controller is the "master" device.
48+
49+
Each connector probably ends up being a separate device, just for the
50+
logistics of finding/mapping io region, irq, etc. Idealy we would
51+
have a better way than just stashing the platform device in a global
52+
(ie. like DT super-node.. but I don't have any snapdragon hw yet that
53+
is using DT).
54+
55+
Note that so far I've not been able to get any docs on the hw, and it
56+
seems that access to such docs would prevent me from working on the
57+
freedreno gallium driver. So there may be some mistakes in register
58+
names (I had to invent a few, since no sufficient hint was given in
59+
the downstream android fbdev driver), bitfield sizes, etc. My current
60+
state of understanding the registers is given in the envytools rnndb
61+
files at:
62+
63+
https://github.com/freedreno/envytools/tree/master/rnndb
64+
(the mdp4/hdmi/dsi directories)
65+
66+
These files are used both for a parser tool (in the same tree) to
67+
parse logged register reads/writes (both from downstream android fbdev
68+
driver, and this driver with register logging enabled), as well as to
69+
generate the register level headers.

0 commit comments

Comments
 (0)