26 Commits

Author SHA1 Message Date
Abhijit Kulkarni
6616a558a9 drm/msm: enable support for custom power ioctl
This change adds support of msm_power_ctrl ioctl from msm display
driver. This ioctl is required to enable/disable display power
before/after accessing display core registers by clients.
TZ asynchronously accesses display domain registers without display
driver knowledge.This ioctl provides any such clients capability
to add/remove vote on display core clocks and power rail.

Change-Id: Ibf564ee3ad44884da55bf8a1e62f9d409ecf947b
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Signed-off-by: Shubhashree Dhar <dhar@codeaurora.org>
2019-03-27 15:27:59 +05:30
Manoj Kumar AVM
1bcefe3c0d drm/msm: make msm_drm.h uapi header safe for C++
fixes the C++ related compilation issues.

CRs-Fixed: 2038080
Change-Id: If6b4f379eb27f3de6153b8666f733c0b8245851f
Signed-off-by: Manoj Kumar AVM <manojavm@codeaurora.org>
2018-11-15 06:00:44 -08:00
Abhijit Kulkarni
4825eb569e drm/msm/sde: add support for hw recovery event notification
Add support to provide hardware recovery event notification
to registered clients. It supports three events: capture, reset
and sucecess. Client can capture the debug log when it receives
"capture" event. It can hard reset the mdss core by turning off
all displays when it receives "reset" event. sde drm driver
provides "success" notification when recovery is successful.

Change-Id: Ieeb0fbf3ca6961e7056b9c909a63170cdd415751
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2018-06-02 11:44:37 -07:00
Ajay Singh Parmar
d83a7518c1 drm/msm: add HDR EOTF values
Define HDR (High Dynamic Range) EOTF (Electro-Optical Transfer Function)
standard values that can be used by user modules.

Change-Id: I34b75630df8c668e37bdf3e23fa78b35f1d18560
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2018-02-08 16:29:28 -08:00
Ajay Singh Parmar
8ab1a67e30 drm/msm: pass the HDR metadata sent from userspace to sink
Use metadata information sent from userspace to configure sink.

This info is used later on to program the HDMI specific
infoframe registers.

CRs-Fixed: 2110071
Change-Id: I26634452d8c3ab7ab49a65e89ad52a3961c64855
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2017-12-11 17:16:36 -05:00
Srikanth Rajagopalan
5a9313524e drm/msm: add sink capabilities for HDR support
Populate HDR sink capabilities to a DRM blob.

These capabilities are used by the userspace
to calculate the sink HDR properties and set them.

CRs-Fixed: 2110071
Change-Id: I7c2dbca375c456052ad73889b011553090bcf8f1
Signed-off-by: Srikanth Rajagopalan <rasrik@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2017-12-11 17:16:36 -05:00
Sandeep Panda
222e8d9051 drm/msm: create ESD worker thread to check panel status
Create ESD worker thread which periodically checks for
panel status. If panel health check is successful then
reschedule the work to be executed after a predefined delay.
If panel does not respond then PANEL_DEAD will reported to
user space to trigger the recovery procedure.

Change-Id: I58ab04dabd47b07ef6df80bdb9b22c20e087deec
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2017-11-27 15:27:12 -08:00
Steve Cohen
4e38a206c2 drm/msm: Add snapshot of SDE and supporting drivers
Snapshot of SDE driver.  This includes DRM SDE, DP, and DSI drivers,
v4l2 rotator driver, and clk driver for display plls.  Upstream changes
to drm/msm have been merged but require further fixes and validation
before enabling this driver.  Snapshot was taken from msm-4.9 as of:
commit f54b6540b397 ("wil6210: add proper locking in cfg suspend")

Change-Id: Ied16c0c33d1321c96f080bc7dafe0ab302657861
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2017-10-30 16:27:51 -04:00
Jordan Crouse
cdbc78ba70 drm/msm: Remove __user from __u64 data types
__user should be used to identify user pointers and not __u64
variables containing pointers.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-08-01 19:11:48 -04:00
Jordan Crouse
49fd08baa3 drm/msm: Add hint to DRM_IOCTL_MSM_GEM_INFO to return an object IOVA
Modify the 'pad' member of struct drm_msm_gem_info to 'flags'. If the
user sets 'flags' to non-zero it means that they want a IOVA for the
GEM object instead of a mmap() offset. Return the iova in the 'offset'
member.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
[robclark: s/hint/flags in commit msg]
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-06-16 11:15:47 -04:00
Jordan Crouse
167b606aa2 drm/msm: Remove DRM_MSM_NUM_IOCTLS
The ioctl array is sparsely populated but the compiler will make sure
that it is sufficiently sized for all the values that we have so we
can safely use ARRAY_SIZE() instead of having a constantly changing
#define in the uapi header.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-06-16 11:15:46 -04:00
Jordan Crouse
e3689e470f drm/msm: Add MSM_PARAM_GMEM_BASE
User space needs to know where the GMEM whole starts so that they
can set up the addressing correctly.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-04-08 06:59:36 -04:00
Rob Clark
7f6337ffb8 drm/msm: update uapi header license
The same file in libdrm is, as is the tradition with the rest of libdrm,
etc, using an MIT license.  To avoid complications in the future with
sync'ing the uapi header to libdrm, lets fix the license mismatch now
before there are any non-trivial commits from someone other than myself.

Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Gabriel Laskar <gabriel@lse.epita.fr>
Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-11-26 15:44:16 -05:00
Rob Clark
4cd0945901 drm/msm: submit support for out-fences
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-15 17:47:40 -04:00
Rob Clark
f0a42bb542 drm/msm: submit support for in-fences
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-15 17:39:49 -04:00
Rob Clark
d9c181e22a drm/msm: extend the submit ioctl to pass in flags
We'll want to be able to pass in flags, such as asking for explicit
fencing, and possibly other things down the road.  Fortunately we
don't need a full 32b for the pipe-id.  So use the upper 16 bits
for flags (which could be extended or reduced later if needed, so
start adding flags from the high bits).

Since anything with the upper bits set would not be a valid pipe-id,
an old userspace would not set any of the upper bits, and an old
kernel would reject it as an invalid pipe-id.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-15 17:21:13 -04:00
Rob Clark
4cd33c48ea drm/msm: add madvise ioctl
Doesn't do anything too interesting until we wire up shrinker.  Pretty
much lifted from i915.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-07-16 10:09:05 -04:00
Emil Velikov
a62424e29d drm/msm: add extern C guard for the UAPI header
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robdclark@gmail.com> (over irc)
2016-05-13 14:06:08 +01:00
Rob Clark
6c77d1abe6 drm/msm: add timestamp param
We need this for GL_TIMESTAMP queries.

Note: currently only supported on a4xx.. a3xx doesn't have this
always-on counter.  I think we could emulate it with the one CP
counter that is available, but for now it is of limited usefulness
on a3xx (since we can't seem to do time-elapsed queries in any sane
way with the existing firmware on a3xx, and if you are trying to do
profiling on a tiler you want time-elapsed).  We can add that later
if it becomes useful.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:32 -05:00
Rob Clark
4102a9e532 drm/msm: add max-freq gpu param to uapi
We need this in userspace for interpreting some of the perf ctrs.

Note possibly not quite sufficient if we had some frequency mgmt
approach other than race-to-idle.  Not really sure what the best
thing to do if we did.  Although displaying results as a percentage
of max frequence seems sensible(ish) if we did.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-02-11 06:25:54 +10:00
Rob Clark
8979a05928 drm/msm: trivial whitespace fix
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-12-14 11:49:33 -05:00
Gabriel Laskar
06577d042d drm: fix inclusion of drm.h in msm_drm.h
Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
2015-12-10 12:33:23 +01:00
Mikko Rapeli
7f8fc88613 drm/msm: use __s32, __s64, __u32 and __u64 from linux/types.h for uabi
Fixes userspace compilation errors like:

error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-06-11 13:11:05 -04:00
Rob Clark
93ddb0d3b0 drm/msm: validate flags, etc
After reading a nice article on LWN[1], I went back and double checked
my handling of invalid-input checking.  Turns out there were a couple
places I had missed.

Since the driver is fairly young, and the devices it supports are really
only just barely usable for basic stuff (serial console) with an
upstream kernel, I think we should fix this now and revert specific
parts of this patch later in the unlikely event that a regression is
reported.

[1] https://lwn.net/Articles/588444/

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-03-31 10:27:46 -04:00
Rob Clark
4e1cbaa3eb drm/msm: add chip-id param
Some of the w/a or different behavior of userspace blob driver seem to
be keyed to gpu patch revision, rather than gpu-id.  So expose the full
chip-id to userspace so it can DTRT.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-03-31 10:27:46 -04:00
Rob Clark
7198e6b031 drm/msm: add a3xx gpu support
Add initial support for a3xx 3d core.

So far, with hardware that I've seen to date, we can have:
 + zero, one, or two z180 2d cores
 + a3xx or a2xx 3d core, which share a common CP (the firmware
   for the CP seems to implement some different PM4 packet types
   but the basics of cmdstream submission are the same)

Which means that the eventual complete "class" hierarchy, once
support for all past and present hw is in place, becomes:
 + msm_gpu
   + adreno_gpu
     + a3xx_gpu
     + a2xx_gpu
   + z180_gpu

This commit splits out the parts that will eventually be common
between a2xx/a3xx into adreno_gpu, and the parts that are even
common to z180 into msm_gpu.

Note that there is no cmdstream validation required.  All memory access
from the GPU is via IOMMU/MMU.  So as long as you don't map silly things
to the GPU, there isn't much damage that the GPU can do.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-08-24 14:57:18 -04:00