Commit Graph

352 Commits

Author SHA1 Message Date
Thomas Zimmermann
85438a8ddf drm: Add |struct drm_gem_vram_object| and helpers
The type |struct drm_gem_vram_object| implements a GEM object for simple
framebuffer devices with dedicated video memory. The BO is either located
in VRAM or system memory.

The implementation has been created from the respective code in ast,
bochs and mgag200. These drivers copy their implementation from each
other; except for the names of several data types. The helpers are
currently build with TTM, but this is considered an implementation
detail and may change in future updates.

v5:
	* do WARN_ON_ONCE for pin-count mismatches
	* allocate only 2 entries in placements array
v4:
	* cleanups from checkpatch.pl
	* removed several fixed-size types from interfaces
	* DRM_VRAM_HELPER now selects DRM_TTM
	* remove separate config option for GEM VRAM
v2:
	* rename to |struct drm_gem_vram_object|
	* move drm_is_gem_ttm() to a later patch in the series
	* add drm_gem_vram_kmap_at()
	* return is_iomem from kmap functions
	* redefine TTM placement flags for public interface
	* documentation fixes

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20190508082630.15116-2-tzimmermann@suse.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-15 16:17:04 +02:00
Noralf Trønnes
03a9606e7f drm/fb-helper: Avoid race with DRM userspace
drm_fb_helper_is_bound() is used to check if DRM userspace is in control.
This is done by looking at the fb on the primary plane. By the time
fb-helper gets around to committing, it's possible that the facts have
changed.

Avoid this race by holding the drm_device->master_mutex lock while
committing. When DRM userspace does its first open, it will now wait
until fb-helper is done. The helper will stay away if there's a master.

Two igt tests fail with the new 'bail out if master' rule. Work around
this by relaxing this rule for drm_fb_helper_restore_fbdev_mode_unlocked()
until the tests have been fixed. Add todo entry for this.

Locking rule: Always take the fb-helper lock first.

v5: drm_fb_helper_restore_fbdev_mode_unlocked(): Use
    restore_fbdev_mode_force()

v2:
- Remove drm_fb_helper_is_bound() (Daniel Vetter)
- No need to check fb_helper->dev->master in
  drm_fb_helper_single_fb_probe(), restore_fbdev_mode() has the check.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190506180139.6913-3-noralf@tronnes.org
2019-05-14 16:11:28 +02:00
Ramalingam C
6498bf5800 drm: revocation check at drm subsystem
On every hdcp revocation check request SRM is read from fw file
/lib/firmware/display_hdcp_srm.bin

SRM table is parsed and stored at drm_hdcp.c, with functions exported
for the services for revocation check from drivers (which
implements the HDCP authentication)

This patch handles the HDCP1.4 and 2.2 versions of SRM table.

v2:
  moved the uAPI to request_firmware_direct() [Daniel]
v3:
  kdoc added. [Daniel]
  srm_header unified and bit field definitions are removed. [Daniel]
  locking improved. [Daniel]
  vrl length violation is fixed. [Daniel]
v4:
  s/__swab16/be16_to_cpu [Daniel]
  be24_to_cpu is done through a global func [Daniel]
  Unused variables are removed. [Daniel]
  unchecked return values are dropped from static funcs [Daniel]

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Acked-by: Satyeshwar Singh <satyeshwar.singh@intel.com>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190507162745.25600-5-ramalingam.c@intel.com
2019-05-09 09:44:41 +02:00
Sam Ravnborg
788033a92a drm: drop drm_bus from todo
David Herrmann removed the last bits of drm_bus in:
commit c5786fe5f1 ("drm: Goody bye, drm_bus!")

Remove the todo item.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com> [I miss drm_bus!]
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20190126192732.15263-1-sam@ravnborg.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190126192732.15263-1-sam@ravnborg.org
2019-04-27 18:19:32 +02:00
Gerd Hoffmann
b7147e9a15 drm: add drm_format_helper.c to kerneldoc
Also drop the dstclip parameter sphinx has warned about (leftover from
an earlier patch version).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20190416090533.28374-1-kraxel@redhat.com
2019-04-17 09:39:22 +02:00
Sean Paul
91b350a605 Documentation/gpu/meson: Remove link to meson_canvas.c
The file was removed in the below patch and is causing this error:
WARNING: kernel-doc '../scripts/kernel-doc -rst -enable-lineno -function Canvas ../drivers/gpu/drm/meson/meson_canvas.c' failed with return code

Fixes: 2bf6b5b0e3 ("drm/meson: exclusively use the canvas provider module")
Cc: Maxime Jourdan <mjourdan@baylibre.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190403205652.183496-1-sean@poorly.run
2019-04-05 08:35:05 -04:00
Daniel Vetter
f0f0657b10 drm/doc: Drop "content type" from the legacy kms property table
We want new stuff documented in more verbose form, this table is
deprecated. "content type" is already documented properly.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Fixes: 50525c332b ("drm: content-type property for HDMI connector")
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190326090555.5969-1-daniel.vetter@ffwll.ch
2019-03-26 14:18:51 +01:00
Noralf Trønnes
2194a63a81 drm: Add library for shmem backed GEM objects
This adds a library for shmem backed GEM objects.

v8:
- export drm_gem_shmem_create_with_handle
- call mapping_set_gfp_mask to set default zone to GFP_HIGHUSER
- Add helper drm_gem_shmem_get_pages_sgt()

v7:
- Use write-combine for mmap instead. This is the more common
  case. (robher)

v6:
- Fix uninitialized variable issue in an error path (anholt).
- Add a drm_gem_shmem_vm_open() to the fops to get proper refcounting
  of the pages (anholt).

v5:
- Drop drm_gem_shmem_prime_mmap() (Daniel Vetter)
- drm_gem_shmem_mmap(): Subtract drm_vma_node_start() to get the real
  vma->vm_pgoff
- drm_gem_shmem_fault(): Use vmf->pgoff now that vma->vm_pgoff is correct

v4:
- Drop cache modes (Thomas Hellstrom)
- Add a GEM attached vtable

v3:
- Grammar (Sam Ravnborg)
- s/drm_gem_shmem_put_pages_unlocked/drm_gem_shmem_put_pages_locked/
  (Sam Ravnborg)
- Add debug output in error path (Sam Ravnborg)

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190313004344.24169-1-robh@kernel.org
2019-03-14 12:06:44 -07:00
Noralf Trønnes
2afd9fcba6 drm/tinydrm: Remove tinydrm_device
No more users left so it can go alongside its helpers.
Update the tinydrm docs description and remove todo entry.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190225144232.20761-7-noralf@tronnes.org
2019-03-04 15:31:27 +01:00
Daniel Vetter
86ab67dfcf drm/doc: document recommended component helper usage
Now that component has docs it's worth spending a few words and
hyperlinks on recommended best practices in drm.

v2: Add another item that component shouldn't be preferred over
drm_bridge/panel and similar subsystems already providing specialized
support for specific components (Laurent). Also convert to bullet
list.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190212164615.13370-1-daniel.vetter@ffwll.ch
2019-02-19 12:22:24 +01:00
Rob Herring
1ba627148e
drm: Add reservation_object to drm_gem_object
Many users of drm_gem_object embed a struct reservation_object into
their subclassed struct, so let's add one to struct drm_gem_object.
This will allow removing the reservation object from the subclasses
and removing the ->gem_prime_res_obj callback.

With the addition, add a drm_gem_reservation_object_wait() helper
function for drivers to use in wait ioctls.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190202154158.10443-2-robh@kernel.org
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-19 11:08:40 +01:00
Maxime Ripard
d588100baa
Merge drm/drm-next into drm-misc-next
We need to backmerge drm-next to fix the komeda build failure.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-11 10:35:35 +01:00
Shayenne Moura
7bd0a3271e drm/doc: Remove solved KMS cleanup task
Remove KMS cleanup task from documentation solved by patchset
https://patchwork.freedesktop.org/series/54310/

Signed-off-by: Shayenne Moura <shayenneluzmoura@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190208195312.aqv7acr3hgion5yz@smtp.gmail.com
2019-02-11 09:30:26 +01:00
Daniel Vetter
badfa5be85 drm/doc: Make igts for cross-driver stuff strongly suggested
Compared to the RFC[1] no changes to the patch itself, but igt moved
forward a lot:

- gitlab CI builds with: reduced configs/libraries, arm cross build
  and a sysroot build (should address all the build/cross platform
  concerns raised in the RFC discussions).

- tests reorganized into subdirectories so that the i915-gem tests
  don't clog the main/shared tests directory anymore

- quite a few more non-intel people contributing/reviewing/committing
  igt tests patches.

I think this addresses all the concerns raised in the RFC discussions,
and assuming there's enough Acks and no new issues that pop up, we can
go ahead with this.

v2:
- Use "should" (in the usual RFC sense) to make it clear that in the
  end this is all up to reviewer's discretion, as usual (Jani).
- Also in the title s/mandatory/strongly suggested/ (me)
- Make it clear we're not going to block features if a testcase is not
  feasible, given hw and state of igt, both having some good gaps in
  what can be tested (Harry, Eric, Sean, ...).

1: https://patchwork.kernel.org/patch/10648851/
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Eric Anholt <eric@anholt.net>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: "Wentland, Harry" <Harry.Wentland@amd.com>
Cc: Brian Starkey <Brian.Starkey@arm.com>
Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Acked-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Acked-by: Sean Paul <sean@poorly.run>
Acked-by: "Wentland, Harry" <Harry.Wentland@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Brian Starkey <brian.starkey@arm.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190128172258.9585-1-daniel.vetter@ffwll.ch
2019-02-07 11:13:12 +01:00
Shayenne Moura
8c77b22243 drm/doc: Remove solved "VBlank issues"
Remove the list of broken tests on VKMS solved by patchset
https://patchwork.freedesktop.org/series/55994/

Signed-off-by: Shayenne Moura <shayenneluzmoura@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190206193157.3b53ipdxtcqc4hv4@smtp.gmail.com
2019-02-06 21:40:56 +01:00
Dave Airlie
37fdaa3390 drm-misc-next for 5.1:
UAPI Changes:
 
 Cross-subsystem Changes:
 
 Core Changes:
   - Split out some part of drm_crtc_helper.h into drm_probe_helper.h
   - DRIVER_* flags improvements
   - New tasks on the TODO-list
   - Improvements to the documentation
 
 Driver Changes:
   - Continual of drmP.h removal in multiple drivers
   - Removal of FBINFO_(FLAG_)DEFAULT in multiple drivers
   - sun4i: Addition of the A23 support, multiple fixes for the tiled
     formats
   - atmel-hlcdc: Fix of clipping and rotation properties
   - qxl: various BO-related improvements, prime and generic fbdev emulation
     support
   - dw-hdmi: Support for HDMI2.0 2160p modes and YUV420 output
   - New Sitronix ST7701 panel driver
   - New Kingdisplay KD097D04 panel driver
   - New LeMaker BL035-RGB-002 panel driver
   - New PDA 91-00156-A0 panel driver
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXFRb/wAKCRDj7w1vZxhR
 xXj2AQDFAkH0/tksJ+T6yrHZXQE7q/6fAWTlrDXLo7Nb1hhfswEA1AyaHmZJA0Ar
 u7S+4Gfzs/gisw9Jr4bqQaerEpYJxQA=
 =qumD
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2019-02-01' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 5.1:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:
  - Split out some part of drm_crtc_helper.h into drm_probe_helper.h
  - DRIVER_* flags improvements
  - New tasks on the TODO-list
  - Improvements to the documentation

Driver Changes:
  - Continual of drmP.h removal in multiple drivers
  - Removal of FBINFO_(FLAG_)DEFAULT in multiple drivers
  - sun4i: Addition of the A23 support, multiple fixes for the tiled
    formats
  - atmel-hlcdc: Fix of clipping and rotation properties
  - qxl: various BO-related improvements, prime and generic fbdev emulation
    support
  - dw-hdmi: Support for HDMI2.0 2160p modes and YUV420 output
  - New Sitronix ST7701 panel driver
  - New Kingdisplay KD097D04 panel driver
  - New LeMaker BL035-RGB-002 panel driver
  - New PDA 91-00156-A0 panel driver

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190201144749.t3abxvguhstu6bcl@flea
2019-02-04 14:42:34 +10:00
Dave Airlie
74b7d6a913 Merge branch 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-next
This pull includes the new Arm "komeda" DRM driver. It is currently hosted
in the same repo as the other "mali-dp" driver because it is the next
iteration of the IP.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Liviu Dudau <Liviu.Dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190131173600.GN25147@e110455-lin.cambridge.arm.com
2019-02-01 10:01:50 +10:00
Sean Paul
d60ea31a87 drm/TODO: Add drm_display_mode.hsync/vrefresh removal
Drivers shouldn't be using these values, add a TODO so someone removes
them.

Changes in v2:
- Add drm_display_mode.vrefresh removal (Ville)
- Add Sam's R-b and bonus points
Changes in v3:
- Add hsync removal todo item (Daniel)
- Change vrefresh wording to make removal less optional

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190129192637.73296-1-sean@poorly.run
2019-01-31 13:01:26 -05:00
Daniel Vetter
d9f7bb56c2 drm/doc: Drop chapter "KMS Initialization and Cleanup"
It only talks about crtc, brings up intel as an example and I think is
more misleading than useful really. Plus we have lots of discussion
about how your standard kms driver should be initialized/cleaned up,
so maybe better to document this when we have a better idea.

v2: Fix typo in commit message (Nicholas).

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190130163006.28945-2-daniel.vetter@ffwll.ch
2019-01-30 22:16:18 +01:00
Daniel Vetter
5d0aa37855 drm/doc: Move hdmi infoframe docs
.. next to all the other sink helpers. The rect library is more used
for handling plane clipping, so belongs to those imo.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190130163006.28945-1-daniel.vetter@ffwll.ch
2019-01-30 22:15:53 +01:00
Daniel Vetter
e57924d4ae drm/doc: Task to rename CMA helpers
I'm kinda fed up explaining why the have a confusing name :-)

v2: Fix typo that Eric Engestrom spotted.

Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190129132153.28844-1-daniel.vetter@ffwll.ch
2019-01-30 18:02:10 +01:00
Daniel Vetter
0e2a933b02 drm: Switch DRIVER_ flags to an enum
And move the documenation we alreay have into kerneldoc, plus a bit of
polish while at it.

v2:
- Ditch FIXME from commit message, I've resolved that already before
  sending out the first version.
- Put the legacy DRIVER_ flags at the end (Sam).

Cc: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190129104248.26607-2-daniel.vetter@ffwll.ch
2019-01-29 15:45:12 +01:00
Noralf Trønnes
bd59f2b153 drm/todo: Tick off some tinydrm entries
- Better manual-upload support for atomic
  The new damage helper has the necessary pieces to make this work.

- tinydrm_gem_cma_prime_import_sg_table
  This is now moved to the CMA helper and can be set using the
  DRM_GEM_CMA_VMAP_DRIVER_OPS macro.

- tinydrm_fb_create
  This is now covered by drm_gem_fb_create_with_dirty()

Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190115043643.2364-6-noralf@tronnes.org
2019-01-17 10:57:27 +01:00
james qian wang (Arm Technology China)
557c37360e drm/doc: Add initial komeda driver documentation
v2: Some editing changes according to Randy Dunlap's comments

Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-01-14 11:20:11 +00:00
Sam Ravnborg
e9eafcb589 drm: move drm_can_sleep() to drm_util.h
Move drm_can_sleep() out of drmP.h to allow users
to get rid of the drmP.h include.

There was no header file that was a good match for this helper function.
So add this to drm_util with the relevant includes.

Add include of drm_util.h to all users.

v2:
- Update comments to use kernel-doc style (Daniel)
- Add FIXME to drm_can_sleep and add note that this
  function should not be used in new code (Daniel)

v3:
- Fix kernel-doc syntax (Daniel)
- Plug drm_util.h into drm-internels.rst (Daniel)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190112193251.20450-2-sam@ravnborg.org
2019-01-14 10:58:37 +01:00
Daniel Vetter
b981a6863e drm/doc: Move bridge link target to the right place
I screwed up a rebase somehow.

v2: Drop bogus hunk.

v3: Really drop bogus hunk (Lubomir).

Cc: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190111164048.29067-4-daniel.vetter@ffwll.ch
2019-01-12 13:08:22 +01:00
Daniel Vetter
3214a16684 drm/doc: Polish kerneldoc for drm_device.h
- Move all the legacy gunk at the bottom, and exclude it from
  kerneldoc.
- Documentation for the remaining bits.

v2: Fix typo (Sam).

Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190111164048.29067-5-daniel.vetter@ffwll.ch
2019-01-11 23:19:49 +01:00
Brian Starkey
3affaa5a7c drm/afbc: Add AFBC modifier usage documentation
AFBC is a flexible, proprietary, lossless compression protocol and
format, with a number of defined DRM format modifiers. To facilitate
consistency and compatibility between different AFBC producers and
consumers, document the expectations for usage of the AFBC DRM format
modifiers in a new .rst chapter.

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
[Updated MAINTAINERS entry to show that "Mali DP Maintainers" is
 actually a mailing list and added an SPDX-License-Identifier to
 the documentation]
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-01-11 17:52:06 +00:00
Maxime Ripard
23d19ba06b
Merge drm/drm-next into drm-misc-next
drm-next has been forwarded to 5.0-rc1, and we need it to apply the damage
helper for dirtyfb series from Noralf Trønnes.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-01-11 16:32:10 +01:00
Lyude Paul
ebcc0e6b50 drm/dp_mst: Introduce new refcounting scheme for mstbs and ports
The current way of handling refcounting in the DP MST helpers is really
confusing and probably just plain wrong because it's been hacked up many
times over the years without anyone actually going over the code and
seeing if things could be simplified.

To the best of my understanding, the current scheme works like this:
drm_dp_mst_port and drm_dp_mst_branch both have a single refcount. When
this refcount hits 0 for either of the two, they're removed from the
topology state, but not immediately freed. Both ports and branch devices
will reinitialize their kref once it's hit 0 before actually destroying
themselves. The intended purpose behind this is so that we can avoid
problems like not being able to free a remote payload that might still
be active, due to us having removed all of the port/branch device
structures in memory, as per:

commit 91a25e4631 ("drm/dp/mst: deallocate payload on port destruction")

Which may have worked, but then it caused use-after-free errors. Being
new to MST at the time, I tried fixing it;

commit 263efde31f ("drm/dp/mst: Get validated port ref in drm_dp_update_payload_part1()")

But, that was broken: both drm_dp_mst_port and drm_dp_mst_branch structs
are validated in almost every DP MST helper function. Simply put, this
means we go through the topology and try to see if the given
drm_dp_mst_branch or drm_dp_mst_port is still attached to something
before trying to use it in order to avoid dereferencing freed memory
(something that has happened a LOT in the past with this library).
Because of this it doesn't actually matter whether or not we keep keep
the ports and branches around in memory as that's not enough, because
any function that validates the branches and ports passed to it will
still reject them anyway since they're no longer in the topology
structure. So, use-after-free errors were fixed but payload deallocation
was completely broken.

Two years later, AMD informed me about this issue and I attempted to
come up with a temporary fix, pending a long-overdue cleanup of this
library:

commit c54c7374ff ("drm/dp_mst: Skip validating ports during destruction, just ref")

But then that introduced use-after-free errors, so I quickly reverted
it:

commit 9765635b30 ("Revert "drm/dp_mst: Skip validating ports during destruction, just ref"")

And in the process, learned that there is just no simple fix for this:
the design is just broken. Unfortunately, the usage of these helpers are
quite broken as well. Some drivers like i915 have been smart enough to
avoid accessing any kind of information from MST port structures, but
others like nouveau have assumed, understandably so, that
drm_dp_mst_port structures are normal and can just be accessed at any
time without worrying about use-after-free errors.

After a lot of discussion, me and Daniel Vetter came up with a better
idea to replace all of this.

To summarize, since this is documented far more indepth in the
documentation this patch introduces, we make it so that drm_dp_mst_port
and drm_dp_mst_branch structures have two different classes of
refcounts: topology_kref, and malloc_kref. topology_kref corresponds to
the lifetime of the given drm_dp_mst_port or drm_dp_mst_branch in it's
given topology. Once it hits zero, any associated connectors are removed
and the branch or port can no longer be validated. malloc_kref
corresponds to the lifetime of the memory allocation for the actual
structure, and will always be non-zero so long as the topology_kref is
non-zero. This gives us a way to allow callers to hold onto port and
branch device structures past their topology lifetime, and dramatically
simplifies the lifetimes of both structures. This also finally fixes the
port deallocation problem, properly.

Additionally: since this now means that we can keep ports and branch
devices allocated in memory for however long we need, we no longer need
a significant amount of the port validation that we currently do.

Additionally, there is one last scenario that this fixes, which couldn't
have been fixed properly beforehand:

- CPU1 unrefs port from topology (refcount 1->0)
- CPU2 refs port in topology(refcount 0->1)

Since we now can guarantee memory safety for ports and branches
as-needed, we also can make our main reference counting functions fix
this problem by using kref_get_unless_zero() internally so that topology
refcounts can only ever reach 0 once.

Changes since v4:
* Change the kernel-figure summary for dp-mst/topology-figure-1.dot a
  bit - danvet
* Remove figure numbers - danvet

Changes since v3:
* Remove rebase detritus - danvet
* Split out purely style changes into separate patches - hwentlan

Changes since v2:
* Fix commit message - checkpatch
* s/)-1/) - 1/g - checkpatch

Changes since v1:
* Remove forward declarations - danvet
* Move "Branch device and port refcounting" section from documentation
  into kernel-doc comments - danvet
* Export internal topology lifetime functions into their own section in
  the kernel-docs - danvet
* s/@/&/g for struct references in kernel-docs - danvet
* Drop the "when they are no longer being used" bits from the kernel
  docs - danvet
* Modify diagrams to show how the DRM driver interacts with the topology
  and payloads - danvet
* Make suggested documentation changes for
  drm_dp_mst_topology_get_mstb() and drm_dp_mst_topology_get_port() -
  danvet
* Better explain the relationship between malloc refs and topology krefs
  in the documentation for drm_dp_mst_topology_get_port() and
  drm_dp_mst_topology_get_mstb() - danvet
* Fix "See also" in drm_dp_mst_topology_get_mstb() - danvet
* Rename drm_dp_mst_topology_get_(port|mstb)() ->
  drm_dp_mst_topology_try_get_(port|mstb)() and
  drm_dp_mst_topology_ref_(port|mstb)() ->
  drm_dp_mst_topology_get_(port|mstb)() - danvet
* s/should/must in docs - danvet
* WARN_ON(refcount == 0) in topology_get_(mstb|port) - danvet
* Move kdocs for mstb/port structs inline - danvet
* Split drm_dp_get_last_connected_port_and_mstb() changes into their own
  commit - danvet

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@redhat.com>
Cc: Jerry Zuo <Jerry.Zuo@amd.com>
Cc: Juston Li <juston.li@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-7-lyude@redhat.com
2019-01-10 20:12:19 -05:00
Dave Airlie
8c1a765bc6 drm-misc-next for 5.1:
UAPI Changes:
 
 Cross-subsystem Changes:
   - Turn dma-buf fence sequence numbers into 64 bit numbers
 
 Core Changes:
   - Move to a common helper for the DP MST hotplug for radeon, i915 and
     amdgpu
   - i2c improvements for drm_dp_mst
   - Removal of drm_syncobj_cb
   - Introduction of an helper to create and attach the TV margin properties
 
 Driver Changes:
   - Improve cache flushes for v3d
   - Reflection support for vc4
   - HDMI overscan support for vc4
   - Add implicit fencing support for rockchip and sun4i
   - Switch to generic fbdev emulation for virtio
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXDOTqAAKCRDj7w1vZxhR
 xZ8QAQD4j8m9Ea3bzY5Rr8BYUx1k+Cjj6Y6abZmot2rSvdyOHwD+JzJFIFAPZjdd
 uOKhLnDlubaaoa6OGPDQShjl9p3gyQE=
 =WQGO
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2019-01-07-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 5.1:

UAPI Changes:

Cross-subsystem Changes:
  - Turn dma-buf fence sequence numbers into 64 bit numbers

Core Changes:
  - Move to a common helper for the DP MST hotplug for radeon, i915 and
    amdgpu
  - i2c improvements for drm_dp_mst
  - Removal of drm_syncobj_cb
  - Introduction of an helper to create and attach the TV margin properties

Driver Changes:
  - Improve cache flushes for v3d
  - Reflection support for vc4
  - HDMI overscan support for vc4
  - Add implicit fencing support for rockchip and sun4i
  - Switch to generic fbdev emulation for virtio

Signed-off-by: Dave Airlie <airlied@redhat.com>

[airlied: applied amdgpu merge fixup]
From: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190107180333.amklwycudbsub3s5@flea
2019-01-10 05:58:52 +10:00
Daniel Vetter
be5cadc7e7 drm/todo: Better defio support in the generic fbdev emulation
The current one essentially means you need CMA or a vmalloc backed
object, which makes fbdev emulation a special case.

Since implementing this will be quite a bit of work, capture the idea
in a TODO.

Cc: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190107102238.7789-1-daniel.vetter@ffwll.ch
2019-01-08 09:03:52 +01:00
Linus Torvalds
3868772b99 A fairly normal cycle for documentation stuff. We have a new
document on perf security, more Italian translations, more
 improvements to the memory-management docs, improvements to the
 pathname lookup documentation, and the usual array of smaller
 fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEIw+MvkEiF49krdp9F0NaE2wMflgFAlwmSPkPHGNvcmJldEBs
 d24ubmV0AAoJEBdDWhNsDH5Y9ZoH/joPnMFykOxS0SmdfI7Z+F4EiJct/ZwF9bHx
 T673T0RC30IgnUXGmBl5OtktfWqVh9aGqHOGwgh65ybp2QvzemdP0k6Lu6RtwNk9
 6LfkpvuUb8FzaQmCHnSMzMSDmXtZUw3Z/mOjCBcQtfGAsUULNT08xl+Dr+gwWIWt
 H+gPEEP+MCXTOQO1jm2dHOHW8NGm6XOijMTpOxp/pkoEY5tUxkVB1T//8EeX7LVh
 c1QHzFrufE3bmmubCLtIuyVqZbm/V5l6rHREDQ46fnH/G9fM4gojzsrAL/Y2m4bt
 E4y0XJHycjLMRDimAnYhbPm1ryTFAX1lNzHP3M/EF6Heqx8YHAk=
 =vtwu
 -----END PGP SIGNATURE-----

Merge tag 'docs-5.0' of git://git.lwn.net/linux

Pull documentation update from Jonathan Corbet:
 "A fairly normal cycle for documentation stuff. We have a new document
  on perf security, more Italian translations, more improvements to the
  memory-management docs, improvements to the pathname lookup
  documentation, and the usual array of smaller fixes.

  As is often the case, there are a few reaches outside of
  Documentation/ to adjust kerneldoc comments"

* tag 'docs-5.0' of git://git.lwn.net/linux: (38 commits)
  docs: improve pathname-lookup document structure
  configfs: fix wrong name of struct in documentation
  docs/mm-api: link slab_common.c to "The Slab Cache" section
  slab: make kmem_cache_create{_usercopy} description proper kernel-doc
  doc:process: add links where missing
  docs/core-api: make mm-api.rst more structured
  x86, boot: documentation whitespace fixup
  Documentation: devres: note checking needs when converting
  doc🇮🇹 add some process/* translations
  doc🇮🇹 fixes in process/1.Intro
  Documentation: convert path-lookup from markdown to resturctured text
  Documentation/admin-guide: update admin-guide index.rst
  Documentation/admin-guide: introduce perf-security.rst file
  scripts/kernel-doc: Fix struct and struct field attribute processing
  Documentation: dev-tools: Fix typos in index.rst
  Correct gen_init_cpio tool's documentation
  Document /proc/pid PID reuse behavior
  Documentation: update path-lookup.md for parallel lookups
  Documentation: Use "while" instead of "whilst"
  dmaengine: Add mailing list address to the documentation
  ...
2018-12-29 11:21:49 -08:00
Shayenne da Luz Moura
18ce0906d9 drm: Remove complete task from TODO documentation
This patch remove the follow complete task from TODO documentation:

  drm_mode_config.crtc_idr is misnamed, since it contains all KMS object.
  Should be renamed to drm_mode_config.object_idr.

Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181213225537.nq4dwidn6tma33iv@smtp.gmail.com
2018-12-14 09:36:10 +01:00
Dave Airlie
e69aa5f9b9 Final changes to drm-misc-next for v4.21:
UAPI Changes:
 
 Core Changes:
 - Add dma_fence_get_stub to dma-buf, and use it in drm/syncobj.
 - Add and use DRM_MODESET_LOCK_BEGIN/END helpers.
 - Small fixes to drm_atomic_helper_resume(), drm_mode_setcrtc() and
   drm_atomic_helper_commit_duplicated_state()
 - Fix drm_atomic_state_helper.[c] extraction.
 
 Driver Changes:
 - Small fixes to tinydrm, vkms, meson, rcar-du, virtio, vkms,
   v3d, and pl111.
 - vc4: Allow scaling and YUV formats on cursor planes.
 - v3d: Enable use of the Texture Formatting Unit, and fix
   prime imports of buffers from other drivers.
 - Add support for the AUO G101EVN010 panel.
 - sun4i: Enable support for the H6 display engine.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAlwI7wUACgkQ/lWMcqZw
 E8O/3g/9GQvNpNthglt4kSXUn9bj2D/MzQsL4sEsKYcp9eM3XTMy6raybfBpMdtf
 U9y7G9EwQ8F01wd1m3d3HfBkKoy0WDTIsAjh06QUuSyyEivuQEoSxCKiI7t+Tatc
 gJaj2TKHF1RaDikcV+x2pqqv8ptH+IzF0A65v5SAn8U5PVYz17pD0jctYR8F434X
 o1xkjL5KS+vmfzu2keUCrWWtfAsPoyqcbEu5A3W+hhpKyQmS/8kVwr5J5LylvWqa
 xalXHRUgaUrOGOFuYrqWhIKjydqpr8QhIuJqacmHfmV/qvASUTeqTTnzartb+FuU
 d5E4p3bFaAjbAOHUEdlaLRA4oUK8/VA+WWaGKhPGreUE3TWn/thJJElAqoJhkbql
 bGelBBkNNzDbJhtwjR4hmFN7fQz0Y1LxuBXtjw7wfomJAd/xJ5fgxqT58OovZgZt
 f+hxxBTsdov5MOZ3XsB457b2MNmM+4kHM7urP3Z7mluEJ0ojmiokYMGJx0RDtLzP
 YoukpqEwCaMlS4rdvil1nUfYw61/PFRxoBwlmarV2A3m1DUDQ2YyUNHOgVLrlzXv
 RGdiTBvuvUZm6aSuzCVUiiiuQ0zwaFfBKdwXEA016irb34rdOoZ2b6w70GWi7QEl
 0tQy5ULBwuhy1Kk8QXsJxRZPnnHznGoREryNDDOC0RAr/WEhwGY=
 =t02J
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-12-06' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

Final changes to drm-misc-next for v4.21:

UAPI Changes:

Core Changes:
- Add dma_fence_get_stub to dma-buf, and use it in drm/syncobj.
- Add and use DRM_MODESET_LOCK_BEGIN/END helpers.
- Small fixes to drm_atomic_helper_resume(), drm_mode_setcrtc() and
  drm_atomic_helper_commit_duplicated_state()
- Fix drm_atomic_state_helper.[c] extraction.

Driver Changes:
- Small fixes to tinydrm, vkms, meson, rcar-du, virtio, vkms,
  v3d, and pl111.
- vc4: Allow scaling and YUV formats on cursor planes.
- v3d: Enable use of the Texture Formatting Unit, and fix
  prime imports of buffers from other drivers.
- Add support for the AUO G101EVN010 panel.
- sun4i: Enable support for the H6 display engine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
[airlied: added drm/v3d: fix broken build to the merge commit]
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/321be9d3-ab75-5f92-8193-e5113662edef@linux.intel.com
2018-12-07 11:23:05 +10:00
Dave Airlie
1f9a5dce35 Merge tag 'vmwgfx-next-2018-12-05' of git://people.freedesktop.org/~thomash/linux into drm-next
Pull request of 2018-12-05

Page flip with damage by Deepak and others,
Various vmwgfx minor fixes anc cleanups.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thomas Hellstrom <thellstrom@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181205103554.3675-1-thellstrom@vmware.com
2018-12-06 13:43:56 +10:00
Dave Airlie
513126ae00 Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next
amdgpu and amdkfd:
- Freesync support
- ABM support in DC
- KFD support for vega12 and polaris12
- Add sdma paging queue support for vega
- Use ACPI to query backlight range on supported platforms
- Clean up doorbell handling
- KFD fix for pasid handling under non-HWS
- Misc cleanups and fixes

scheduler:
- Revert "fix timeout handling v2"

radeon:
- Fix possible overflow on 32 bit

ttm:
- Fix for LRU handling for ghost objects

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181130192505.2946-1-alexander.deucher@amd.com
2018-12-06 13:29:09 +10:00
Dave Airlie
467e8a516d Final drm/i915 changes for v4.21:
- ICL DSI video mode enabling (Madhav, Vandita, Jani, Imre)
 - eDP sink count fix (José)
 - PSR fixes (José)
 - DRM DP helper and i915 DSC enabling (Manasi, Gaurav, Anusha)
 - DP FEC enabling (Anusha)
 - SKL+ watermark/ddb programming improvements (Ville)
 - Pixel format fixes (Ville)
 - Selftest updates (Chris, Tvrtko)
 - GT and engine workaround improvements (Tvrtko)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFWWmW3ewYy4RJOWc05gHnSar7m8FAlwGv7oACgkQ05gHnSar
 7m/wkRAAlfpC6fk1IWmaICaNT5h1TepBMShpT7sevRQPA80G5JwBZpbamO9lr9z0
 o+vyWM034STjYizYeYZCC8xxFzU+PIBMTmyYqhqhwBBGqSbXiuTtUNo334FBBWDR
 tTkFwDWVxcMl7LJiBzzQlpKQYUV+YFnL9+s/lW3z5o9JE+5V0V/qZPLZREDV08K1
 QIir59lSmhTTkuaYQe9x2hIjfi1LymNw64v9AaiPB3ILYxkfoL8OK2uoghairRu3
 AcHllYVx2nYFYRx2GrylAtDUHppN2Asmoji6P/zQh415pv4IaXZrK4u+ZlJm8KMz
 94KSowviamRVEH2YCUmDPTFY2yj2v5/Lt9IOV80rQEpqh4x669zY4QiFwtrMzy2L
 +tU52EhdIukzg3yL8az6OD+oOcwhKJp0pbQbPMTsqdrJWBvgwW12zHicV7nWp/rD
 2TAVXJwEWNnm5jqq96+G/CbQNJ+tU4KPcR64I+qt+RaP4vXf/QxbnxsGbRXVbiJO
 31LZMF5sXeRaqrbAqm7Mg4mLYNgfYIqFVznoopL5lXsO6VOD39mVfnrLVAQaGwHL
 Bla1d01BW/3GJtcyb+v/PBsMZKZmyeuoIGN1EQz8+7URw+68tmDutdZKGU1bWez6
 9yoe0crgcLKtdF7rp9ud3AFXqeG5XxqODIBBTQ6uOAX7qbjDST0=
 =RR62
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-next-2018-12-04' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

Final drm/i915 changes for v4.21:
- ICL DSI video mode enabling (Madhav, Vandita, Jani, Imre)
- eDP sink count fix (José)
- PSR fixes (José)
- DRM DP helper and i915 DSC enabling (Manasi, Gaurav, Anusha)
- DP FEC enabling (Anusha)
- SKL+ watermark/ddb programming improvements (Ville)
- Pixel format fixes (Ville)
- Selftest updates (Chris, Tvrtko)
- GT and engine workaround improvements (Tvrtko)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87va496uoe.fsf@intel.com
2018-12-06 09:17:51 +10:00
Lukasz Spintzyk
d3b2176782 drm: Add a new plane property to send damage during plane update
FB_DAMAGE_CLIPS is an optional plane property to mark damaged regions
on the plane in framebuffer coordinates of the framebuffer attached to
the plane.

The layout of blob data is simply an array of "struct drm_mode_rect".
Unlike plane src coordinates, damage clips are not in 16.16 fixed point.
As plane src in framebuffer cannot be negative so are damage clips. In
damage clip, x1/y1 are inclusive and x2/y2 are exclusive.

This patch also exports the kernel internal drm_rect to userspace as
drm_mode_rect. This is because "struct drm_clip_rect" is not sufficient
to represent damage for current plane size.

Driver which are interested in enabling FB_DAMAGE_CLIPS property for a
plane should enable this property using drm_plane_enable_damage_clips.

v2:
- Input validation on damage clips against framebuffer size.
- Doc update, other minor changes.

Signed-off-by: Lukasz Spintzyk <lukasz.spintzyk@displaylink.com>
Signed-off-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2018-12-05 10:00:35 +01:00
Sean Paul
f6d266c279 Merge drm/drm-next into drm-misc-next
Need to pick up the following patch to fix htmldocs build

167bfe534d ("Documentation: drm: Remove dangling pointer from drm-mm.rst")

Signed-off-by: Sean Paul <seanpaul@chromium.org>
2018-11-30 08:47:01 -05:00
Sean Paul
167bfe534d Documentation: drm: Remove dangling pointer from drm-mm.rst
Fixes htmldocs build error:
Error: Cannot open file ../drivers/gpu/drm/drm_global.c

Fixes: 2bb42410b1 ("drm: Remove drm_global.{c,h} v2")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Christian König <christian.koenig@amd.com>
Cc: Junwei Zhang <Jerry.Zhang@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181129155522.33749-1-sean@poorly.run
2018-11-30 08:55:37 +10:00
Sean Paul
22be874012 drm: TODO: Add DRM_MODESET_LOCK_ALL* conversion to todo.rst
We should also get the drivers using the helpers. Seems like a good
intermediate TODO item.

Changes in v2:
- Add line about replacing drm_modest_lock_all() (Daniel)

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20181129195838.222031-1-sean@poorly.run
2018-11-29 15:01:20 -05:00
Dave Airlie
61647c77cb drm-misc-next for v4.21:
Core Changes:
 - Merge drm_info.c into drm_debugfs.c
 - Complete the fake drm_crtc_commit's hw_done/flip_done sooner.
 - Remove deprecated drm_obj_ref/unref functions. All drivers use get/put now.
 - Decrease stack use of drm_gem_prime_mmap.
 - Improve documentation for dumb callbacks.
 
 Driver Changes:
 - Add edid support to virtio.
 - Wait on implicit fence in meson and sun4i.
 - Add support for BGRX8888 to sun4i.
 - Preparation patches for sun4i driver to start supporting linear and tiled YUV formats.
 - Add support for HDMI 1.4 4k modes to meson, and support for VIC alternate timings.
 - Drop custom dumb_map in vkms.
 - Small fixes and cleanups to v3d.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAlv+YOEACgkQ/lWMcqZw
 E8OJvw//fc+j9sJLScvrahLDNZVMh4pTvQCOySmxIPVAhjLZIkRjdvR9Ou51tbL+
 qSm3tDexHEPniR8xmuTYjPZtJP6o4e4NLqUzWYdZb0U+oK3QMuJKDD3uK+6BwM8P
 CyAa4VxV9F17oN+d0aFpoPTHheRVt3egyvREqLHoiAJYtp01cm+f/FFKZSe+o3p/
 QLi0tJ5unXg6AZFoomYbZirE/jp6t8m+cjRkYOafE57+2qpMEJ8RA5G0D1UxCgP2
 imGW6n4N7rmB1bNbtTvFEDGIffE+W9AkVQkJ2YXUfQldtmUKgLA9OG47DIdDb1Xa
 P7RWVjHJejhvu9URcFmQcrjoCtKURPcPTuLZEQHvae1sUxwwMUvtpKUM7TBGYo2I
 G/nQLkMLmK9yfJRyo2OHRHTClduU3X7FXzbJhbL3cUMx0beWjCQmRDjM9ywfSJR3
 lrJIlnQ3voCp0IZWj86RG0idpd3RIjE8Aaqz/m4bSmqMCqmlepnZzIpZcFB7gXbM
 k0xiK4LUFO1VbFsMoRaqrP1zXduY+nbLhfiDiIDs34v0ZVqNooJpLYilRI/lvmXt
 vzApnxgwRePW0vz67Lagqq+ZUXJXptirmGw7bnvfT90cOKlRLi5CDZTRwCOuUNPL
 9kUgXj8EoX9+7p9M14TrEx9tV0MZIwbP8nlS9Ty0Kx4s240mbYg=
 =JNy2
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-11-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v4.21:

Core Changes:
- Merge drm_info.c into drm_debugfs.c
- Complete the fake drm_crtc_commit's hw_done/flip_done sooner.
- Remove deprecated drm_obj_ref/unref functions. All drivers use get/put now.
- Decrease stack use of drm_gem_prime_mmap.
- Improve documentation for dumb callbacks.

Driver Changes:
- Add edid support to virtio.
- Wait on implicit fence in meson and sun4i.
- Add support for BGRX8888 to sun4i.
- Preparation patches for sun4i driver to start supporting linear and tiled YUV formats.
- Add support for HDMI 1.4 4k modes to meson, and support for VIC alternate timings.
- Drop custom dumb_map in vkms.
- Small fixes and cleanups to v3d.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/151a3270-b1be-ed75-bd58-6b29d741f592@linux.intel.com
2018-11-29 10:28:49 +10:00
Nicholas Kazlauskas
ab7a664f7a drm: Document variable refresh properties
These include the drm_connector 'vrr_capable' and the drm_crtc
'vrr_enabled' properties.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-11-28 15:55:34 -05:00
Manasi Navare
a408c857a9 drm/dsc: Add helpers for DSC picture parameter set infoframes
According to Display Stream compression spec 1.2, the picture
parameter set metadata is sent from source to sink device
using the DP Secondary data packet. An infoframe is formed
for the PPS SDP header and PPS SDP payload bytes.
This patch adds helpers to fill the PPS SDP header
and PPS SDP payload according to the DSC 1.2 specification.

v7:
* Use BUILD_BUG_ON() to protect changing struct size (Ville)
* Remove typecaseting (Ville)
* Include byteorder.h in drm_dsc.c (Ville)
* Correct kernel doc spacing (Anusha)
v6:
* Use proper sequence points for breaking down the
assignments (Chris Wilson)
* Use SPDX identifier
v5:
Do not use bitfields for DRM structs (Jani N)
v4:
* Use DSC constants for params that dont change across
configurations
v3:
* Add reference to added kernel-docs in
Documentation/gpu/drm-kms-helpers.rst (Daniel Vetter)

v2:
* Add EXPORT_SYMBOL for the drm functions (Manasi)

Cc: dri-devel@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Acked-by: Sean Paul <seanpaul@chromium.org> (For merging through
drm-intel)
Link: https://patchwork.freedesktop.org/patch/msgid/20181127214125.17658-5-manasi.d.navare@intel.com
2018-11-27 18:35:17 -08:00
Daniel Vetter
39dea70d8a drm: Improve dumb callback docs
Noticed while reviewing a patch from Eric. Also add a todo for the
dumb_map_offset callbacks (it should be simple to do, but piles of
work). Plus fix up vbox, because vbox.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Fabio Rafael da Rosa <fdr@pid42.net>
Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181127091921.8325-1-daniel.vetter@ffwll.ch
2018-11-27 15:23:18 +01:00
Fernando Ramos
a42facc82c docs: drm: remove no longer relevant TODO entry
This entry asked to rename all drm core "*_reference/_unrefence"
functions to "*_get/_put".

Now that this task is complete, we can remove this entry from the TODO
list.

Signed-off-by: Fernando Ramos <greenfoo@gluegarage.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20181115221634.22715-10-greenfoo@gluegarage.com
2018-11-24 22:12:56 +01:00
Dave Airlie
b239499f92 drm-misc-next for v4.21, part 2:
UAPI Changes:
 - Remove syncobj timeline support from drm.
 
 Cross-subsystem Changes:
 - Document canvas provider node in the DT bindings.
 - Improve documentation for TPO TPG110 DT bindings.
 
 Core Changes:
 - Use explicit state in drm atomic functions.
 - Add panel quirk for new GPD Win2 firmware.
 - Add DRM_FORMAT_XYUV8888.
 - Set the default import/export function in prime to drm_gem_prime_import/export.
 - Add a separate drm_gem_object_funcs, to stop relying on dev->driver->*gem* functions.
 - Make sure that tinydrm sets the virtual address also on imported buffers.
 
 Driver Changes:
 - Support active-low data enable signal in sun4i.
 - Fix scaling in vc4.
 - Use canvas provider node in meson.
 - Remove unused variables in sti and qxl and cirrus.
 - Add overlay plane support and primary plane scaling to meson.
 - i2c fixes in drm/bridge/sii902x
 - Fix mailbox read size in rockchip.
 - Spelling fix in panel/s6d16d0.
 - Remove unnecessary null check from qxl_bo_unref.
 - Remove unused arguments from qxl_bo_pin.
 - Fix qxl cursor pinning.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAlv1NiQACgkQ/lWMcqZw
 E8OZ3g/+M3UMxqL5NEscn7tQgD76uWFr7hr76qOTbwqntnGor1h+uqIE4ITF5yBv
 svsNNorzOtz6rDz8HWsi9aDmSYv/MTLURKGHWK3bpeSlY83uLS0e13EhdID9l5iN
 EwcqiA5t8PBR2xTU5+H2gCwb8p9ArmF4azyT12x6s7e33UmNpBlb/bmj03gw8HNA
 37cDVvp0SrPh+JEAqxkL2qBl3412ENYabJr/dioc+SakBMbCDYT2EMFqsV/TLYq1
 ZUQRxTUol2OTWcJTBv2LS86YfYRpK0vVVl7MtFyoFERbOY+o45VyKlA35qAbGcne
 Vem+06HEm6BPfPlCGu3DnsLkN0gnotWyPifm6tE8n3k0sPG0fGgb+qODSyl/8YKb
 k8KQ/ccqEzhqfNnS3X8fSeuyoW6aA7DaEmsVeXlnGNKBzWqGeLxC78uCr7jA+Zgc
 CqUwCgTgXUkIQaZz8RYwlWXzZZyaPRsodsVjRL+7gFl1JTFGvi9QcKTLVo2jq4a0
 V3pNpnuz/+NzePtUc0OE0zBnl3PpFQa1jY8NtRCI99BQ+S/OCGvZMfEkNslb+Z2C
 8p2ka70aVpnzS367Oqw0xpjYxSdbyoyLjDig7YYfMi2IqoNPNeGRF0tMNE+ht84k
 BU/RC7yHa9+EeUa8cM5FMigr/GuIs2lmHQOG6JBHasfSUSRTLio=
 =elpS
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-11-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v4.21, part 2:

UAPI Changes:
- Remove syncobj timeline support from drm.

Cross-subsystem Changes:
- Document canvas provider node in the DT bindings.
- Improve documentation for TPO TPG110 DT bindings.

Core Changes:
- Use explicit state in drm atomic functions.
- Add panel quirk for new GPD Win2 firmware.
- Add DRM_FORMAT_XYUV8888.
- Set the default import/export function in prime to drm_gem_prime_import/export.
- Add a separate drm_gem_object_funcs, to stop relying on dev->driver->*gem* functions.
- Make sure that tinydrm sets the virtual address also on imported buffers.

Driver Changes:
- Support active-low data enable signal in sun4i.
- Fix scaling in vc4.
- Use canvas provider node in meson.
- Remove unused variables in sti and qxl and cirrus.
- Add overlay plane support and primary plane scaling to meson.
- i2c fixes in drm/bridge/sii902x
- Fix mailbox read size in rockchip.
- Spelling fix in panel/s6d16d0.
- Remove unnecessary null check from qxl_bo_unref.
- Remove unused arguments from qxl_bo_pin.
- Fix qxl cursor pinning.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9c0409e3-a85f-d2af-b4eb-baf1eb8bbae4@linux.intel.com
2018-11-22 12:54:38 +10:00
Noralf Trønnes
b39b5394fa drm/gem: Add drm_gem_object_funcs
This adds an optional function table on GEM objects.
The main benefit is for drivers that support more than one type of
memory (shmem,vram,cma) for their buffers depending on the hardware it
runs on. With the callbacks attached to the GEM object itself, it is
easier to have core helpers for the the various buffer types. The driver
only has to make the decision about buffer type on GEM object creation
and all other callbacks can be handled by the chosen helper.

drm_driver->gem_prime_res_obj has not been added since there's a todo to
put a reservation_object into drm_gem_object.

v3: Add todo entry

v2: Drop drm_gem_object_funcs->prime_mmap in favour of
drm_gem_prime_mmap() (Daniel Vetter)

v1:
- drm_gem_object_funcs.map -> .prime_map let it only do PRIME mmap like
  the function it superseeds (Daniel Vetter)
- Flip around the if ladders and make obj->funcs the first choice
  highlighting the fact that this the new default way of doing it
  (Daniel Vetter)

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110145647.17580-4-noralf@tronnes.org
2018-11-20 14:56:18 +01:00
Noralf Trønnes
f001488112 drm/driver: Add defaults for .gem_prime_export/import callbacks
The majority of drivers use drm_gem_prime_export() and
drm_gem_prime_import() for these callbacks so let's make them the
default.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110145647.17580-2-noralf@tronnes.org
2018-11-20 14:54:15 +01:00
Dave Airlie
9235dd441a Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next
New features for 4.21:
amdgpu:
- Support for SDMA paging queue on vega
- Put compute EOP buffers into vram for better performance
- Share more code with amdkfd
- Support for scanout with DCC on gfx9
- Initial kerneldoc for DC
- Updated SMU firmware support for gfx8 chips
- Rework CSA handling for eventual support for preemption
- XGMI PSP support
- Clean up RLC handling
- Enable GPU reset by default on VI, SOC15 dGPUs
- Ring and IB test cleanups

amdkfd:
- Share more code with amdgpu

ttm:
- Move global init out of the drivers

scheduler:
- Track if schedulers are ready for work
- Timeout/fault handling changes to facilitate GPU recovery

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181114165113.3751-1-alexander.deucher@amd.com
2018-11-19 11:07:52 +10:00
Colin Ian King
cba8087d82 Documentation: fix spelling mistake, EACCESS -> EACCES
Trivial fix to a spelling mistake of the error access name EACCESS,
rename to EACCES

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2018-11-07 15:28:55 -07:00
Leo Li
b8592b4845 drm/amd/display: Initial documentation for AMDgpu DC
[Why]
Documentation is helpful for the community to understand our code.
This change does some high-level documentation of some DM interfaces
with DRM, and the amdgpu base driver.

[How]
An entry for AMDgpu DC has been added to Documentation/gpu/drivers.rst
TOC. amdgpu-dc.rst is created to pull in inline doc-strings, which:
- Provides an overview for "What is DM?"
- Documents AMDgpu DM lifecyle
- Documents IRQ management
- Documents atomic_check and commit_tail interfaces

Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-11-05 14:21:37 -05:00
Thomas Zimmermann
e55a5c9b5f drm/ttm: Rename ttm_bo_global_{init,release}() to ttm_bo_global_ref_{,}()
The functions ttm_bo_global_init() and ttm_bo_global_release() do not
receive an argument of type struct ttm_bo_global. Both take a struct
drm_global_reference that contains points to a struct ttm_bo_global_ref.
Renaming them reflects this.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-11-05 14:20:52 -05:00
Daniel Vetter
9edb6a0b20 drm/doc: Update errno handbook
We recently bikeshedded this to a different flavour, but forgot to
update the recommendations.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181019084311.23836-1-daniel.vetter@ffwll.ch
2018-10-24 14:20:36 +02:00
Daniel Vetter
e6a3e405b5 drm/todo: Add some cleanup tasks
Motivated by review comments from Ville&Sean.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Sean Paul <sean@poorly.run>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181004202446.22905-21-daniel.vetter@ffwll.ch
2018-10-05 18:05:32 +02:00
Daniel Vetter
9ef8a9dc4b drm: Extract drm_atomic_state_helper.[hc]
We already have a separate overview doc for this, makes sense to
untangle it from the overall atomic helpers.

v2: Rebase

v3: Rebase more.

Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181004202446.22905-4-daniel.vetter@ffwll.ch
2018-10-05 18:04:09 +02:00
Daniel Vetter
d717c6df30 drm/vkms: Extend todo
Typed up all the items Rodrigo capture at the vkms workshop at
xdc2018:

https://etherpad.net/p/vkms_todo

v2: Review from Rodrigo.
- Add eBPF for atomic check, I forgot it.
- Improve spelling.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181003132103.29309-1-daniel.vetter@ffwll.ch
2018-10-03 18:19:41 +02:00
Dave Airlie
36c9c3c911 Merge branch 'drm-next-4.20' of git://people.freedesktop.org/~agd5f/linux into drm-next
This is a new pull for drm-next on top of last weeks with the following
changes:
- Fixed 64 bit divide
- Fixed vram type on vega20
- Misc vega20 fixes
- Misc DC fixes
- Fix GDS/GWS/OA domain handling

Previous changes from last week:
amdgpu/kfd:
- Picasso (new APU) support
- Raven2 (new APU) support
- Vega20 enablement
- ACP powergating improvements
- Add ABGR/XBGR display support
- VCN JPEG engine support
- Initial xGMI support
- Use load balancing for engine scheduling
- Lots of new documentation
- Rework and clean up i2c and aux handling in DC
- Add DP YCbCr 4:2:0 support in DC
- Add DMCU firmware loading for Raven (used for ABM and PSR)
- New debugfs features in DC
- LVDS support in DC
- Implement wave kill for gfx/compute (light weight reset for shaders)
- Use AGP aperture to avoid gart mappings when possible
- GPUVM performance improvements
- Bulk moves for more efficient GPUVM LRU handling
- Merge amdgpu and amdkfd into one module
- Enable gfxoff and stutter mode on Raven
- Misc cleanups

Scheduler:
- Load balancing support
- Bug fixes

ttm:
- Bulk move functionality
- Bug fixes

radeon:
- Misc cleanups

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180920150438.12693-1-alexander.deucher@amd.com
2018-09-21 09:52:53 +10:00
Haneen Mohammed
ad9ff96f65 drm/vkms: Add kerneldoc entry
Add an initial kerneldoc entry for vkms with a todo list.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
[danvet: Keep the todo.rst entry to point at the vkms docs instead.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180907174136.GA2648@haneenDRM
2018-09-11 20:06:35 +02:00
Daniel Vetter
72fdb40c1a drm: extract drm_atomic_uapi.c
This leaves all the commit/check and state handling in drm_atomic.c,
while pulling all the uapi glue and the huge ioctl itself into a
seprate file.

This seems to almost perfectly split the rather big drm_atomic.c file
into 2 equal sizes.

Also adjust the kerneldoc and type a very terse overview text.

v2: Rebase.

v3: Fix tiny typo.

v4:
- Fixup armada, newly converted atomic driver hooray!
- Fixup msm/dpu1, newly added too.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180905135711.28370-7-daniel.vetter@ffwll.ch
2018-09-09 14:19:18 +02:00
Daniel Vetter
2ec04b33a9 drm: Update todo.rst
- drmP.h is now fully split up.
- vkms is happening (and will gain its own todo and docs under a new
  vkms.rst file real soon)
- legacy cruft is completely hidden now, drm_vblank.c is split out
  from drm_irq.c now. I've decided to drop the task to split out
  drm_legacy.ko, partially because Dave already rejected a patch to
  hide the old dri1 drivers better. Current state feels good enough to
  me.
- best_encoder atomic cleanup is done (it's now the default, not even
  exported anymore)
- bunch of smaller things

v2:
- Explain why the drm_legacy.ko task is dropped (Emil).
- typos (Sam).

v3: Fix typo (Ilia)

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Airlie <airlied@linux.ie>
Link: https://patchwork.freedesktop.org/patch/msgid/20180905181509.19530-1-daniel.vetter@ffwll.ch
2018-09-09 14:19:18 +02:00
Daniel Vetter
d86552efe1 drm/atomic: trim driver interface/docs
Remove the kerneldoc and EXPORT_SYMBOL which aren't used and really
shouldn't ever be used by drivers directly.

Unfortunately this means we need to move the set_writeback_fb function
around to avoid a forward decl.

Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180905135711.28370-5-daniel.vetter@ffwll.ch
2018-09-09 14:19:18 +02:00
Souptick Joarder
b9a40816fe Document/gpu: Use new vm_fault_t type
We have introduce new return type vm_fault_t for
fault handler. Update the document for the same.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180904041505.GA2712@jordon-HP-15-Notebook-PC
2018-09-04 15:07:13 +02:00
Michel Dänzer
851c2509ae drm/doc: Adapt GPU scheduler references for renamed C file
Fixes: "drm/scheduler: rename gpu_scheduler.c to sched_main.c"
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-08-27 11:10:49 -05:00
Sean Paul
bc537a9cc4 Merge drm/drm-next into drm-misc-next
Now that 4.19-rc1 is cut, backmerge it into -misc-next.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
2018-08-27 10:00:03 -04:00
Brian Starkey
7e7b68ef00 drm/fourcc: Add DOC: overview comment
There's a number of things which haven't previously been documented
around the usage of format modifiers. Capture the current
understanding in an overview comment and add it to the rst
documentation.

Ideally, the generated documentation would also include documentation
of all of the #defines, but the kernel-doc system doesn't currently
support kernel-doc comments on #define constants.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180821161611.10424-1-brian.starkey@arm.com
2018-08-21 18:02:30 +01:00
Jordan Crouse
cdb95931de drm/msm/gpu: Add the buffer objects from the submit to the crash dump
For hangs, dump copy out the contents of the buffer objects attached to the
guilty submission and print them in the crash dump report.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2018-07-30 08:50:10 -04:00
Jordan Crouse
50f8d21863 drm/msm/adreno: Add a5xx specific registers for the GPU state
HLSQ, SP and TP registers are only accessible from a special
aperture and to make matters worse the aperture is blocked from
the CPU on targets that can support secure rendering. Luckily the
GPU hardware has its own purpose built register dumper that can
access the registers from the aperture. Add a5xx specific code
to program the crashdumper and retrieve the wayward registers
and dump them for the crash state.

Also, remove a block of registers the regular CPU accessible
list that aren't useful for debug which helps reduce the size
of the crash state file by a goodly amount.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2018-07-30 08:50:06 -04:00
Jordan Crouse
43a56687d1 drm/msm/adreno: Add ringbuffer data to the GPU state
Add the contents of each ringbuffer to the GPU state and dump the
data in the crash file encoded with ascii85. To save space only
the used portions of the ringbuffer are dumped.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2018-07-30 08:50:03 -04:00
Jordan Crouse
bcf1d9fa5d drm/msm/adreno: Convert the show/crash file format
Convert the format of the 'show' debugfs file and the crash
dump to a  format resembling YAML. This should be easier to
parse and be more flexible for future changes and expansions.

v2: Use a standard .rst for the msm crashdump documentation

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2018-07-30 08:50:00 -04:00
Dave Airlie
294f96ae8a drm-misc-next for 4.19:
Core Changes:
 - add support for DisplayPort CEC-Tunneling-over-AUX (Hans Verkuil)
 - more doc updates (Daniel Vetter)
 - fourcc: Add is_yuv field to drm_format_info (Ayan Kumar Halder)
 - dma-buf: correctly place BUG_ON (Michel Dänzer)
 
 Driver Changes:
 - more vkms support(Rodrigo Siqueira)
 - many fixes and small improments to all drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJbT52JAAoJEEN0HIUfOBk06UsQAIy5YwUQ9l+8GdS5bKU299KW
 ZMMi0pTgB/bg0uuqGqN1zf23kpyRTNBGu2UMZgHWTcM4gjTP9qxb5GPFyOhr5he4
 pkp0p13fcn85Mkpt6ZQQD4ErMnhJSodzPRRT+ypnM+HzcWWehQOnSbLWCTOpaCeg
 5SsSFT7RfpDcICXzZZKAHFwHAp1y1y6V027RWu0/amUTwoZPn+ktU/s0thGIdqFk
 EGb/dP4K0PAHE4ZnhZOHPFlYbVQWp0J8X7+NmkXvPgwVPahLvKbNMBfG9M3mGcku
 cMwW8phngd0ih9gd1rblG3J8pdISArg6EgqAwwUV6p8tHUBQff5mL/RTh5zrUs6D
 seLqzRM4V74WDp2meMSYogISo2b+39RiL1IhayTytdW/oaterXloSChAwKUz4pi/
 Nj3/Kn59m9DH9NoAh3DYvDg+e06U9csR6TUJZ0B6BlXIwju9/QLybsDbUdmjtSW+
 yqttEs8m4k2gB2ZRo9y2RVi/XCNv0t+GYa2HQcTGrYVZpIxKioT6WdnlobQZ6L2E
 9CClacN6v2e27cQUbZEFuU7phUkM/nw18dROFrIwJ0OxsA5nElO1DTiOy+KDwzAU
 E+l4DqZZknyxEfTxUq79+9J2HmhqA7ikQbgNJMQyQ25iRFrkvYsI7XfF4ix5z+a5
 I0/CkPP3UsTibnVhM7wn
 =HyBh
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-07-18' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 4.19:

Core Changes:
- add support for DisplayPort CEC-Tunneling-over-AUX (Hans Verkuil)
- more doc updates (Daniel Vetter)
- fourcc: Add is_yuv field to drm_format_info (Ayan Kumar Halder)
- dma-buf: correctly place BUG_ON (Michel Dänzer)

Driver Changes:
- more vkms support(Rodrigo Siqueira)
- many fixes and small improments to all drivers

Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180718200826.GA20165@juma
2018-07-20 10:46:49 +10:00
Dave Airlie
54c88a029a drm-misc-next for 4.19:
Cross-subsystem Changes:
 - many dt-bindings Doc changes
 
 Core Changes:
 - Encoder clean ups (Ville Syrjälä)
 - Connector Writeback improvements(Boris Brezillon)
 - Fake vblank support (Boris Brezillon)
 - API for in-kernel clients (Noralf Trønnes)
 - improvements to the path of finding panels(Boris Brezillon)
 
 Driver Changes:
 - initial support for the virtual display driver - vkms(Haneen Mohammed and Rodrigo Siqueira)
 - panel: add Rocktech RK070ER9427 LCD support (Jagan Teki)
 - panel: add support for the EDT ETM0700G0EDH6 and EDT ETM0700G0BDH6(Jan Tuerk)
 - panel: add DLC DLC0700YZG-1 (Philipp Zabel)
 - panel: add support for BOE HV070WSA-100 (Andrzej Hajda)
 - panel: add newhaven, nhd-4.3-480272ef-atxl LCD (Tomi Valkeinen)
 - panel: add support for Innolux G070Y2-L01 (Christoph Fritz)
 - panel: add support for DataImage SCF0700C48GGU18 (Michal Vokáč)
 - panel: add support for Sharp LQ035Q7DB03 (Vladimir Zapolskiy)
 - panel: p079zca: Refactor panel driver to support multiple panels (Lin Huang)
 - sun4i: Add R40 display engine compatible(Jernej Skrabec)
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJbRqmlAAoJEEN0HIUfOBk0I2wQALu/Kk5y7gVGZWFMP/uImqB5
 vbkNXX5rdzFfvXHbNE9GHVLtMLIJS705pou+wzuUzil3C/xjUUrP7mUdWEVgNl4s
 hj6norNP2Jhd6v+Jua5dwhamDi6RHcroWc6c3SYt//JjcZKtOb/oqwt+7Bu0I+yi
 I+62iMpOVjxOIaygthZiJD89Q0mRsFBELRC1iYm1SxXF0l1/9Hf5Xt9PbUvoMscb
 /74e0MqdqKNTopWz7TLIZT6mHDWLM8IklLkMBDEClZQUMQAfIvPSKhe7KGXnOB0T
 PzBd1MJeQ/rPyyJJtWY5BTng6C38XW5xmq+I4YUSIfRJZjJHf4vBEcJO3ErIxBGj
 LE957F/rT8IYxN0Z31wH0DZhP8KpL1KIXy3AOb7Yqqbu+SemKT/WaepAdFvKfFbO
 5BxBgeFSQg9soHv7ndjOWDQal1AmuIhK/UP18ytYO9T54fPBJ1TaaHUWacYnvo/0
 oQdCTghvFuZgpP3Tl3IisFO1xDpLq4Y4VqvP4xwSj2Id1MUp6MGh9W/A39bc8FA0
 JJcvQYYCcnf4GVQQem+QFk+bpXmzLZW3+/cMpU72zrP+8OKrxD5PwxLmhuqdRzLR
 2lMT5gXEuPl8K8wyOLJDiWbXfZB9jn7Mm+5lySKGKu6NYzLN+cbLPA7+tVsqrWMu
 XLd++4ntNy5hdvS/TO7j
 =Bepe
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-07-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 4.19:

Cross-subsystem Changes:
- many dt-bindings Doc changes

Core Changes:
- Encoder clean ups (Ville Syrjälä)
- Connector Writeback improvements(Boris Brezillon)
- Fake vblank support (Boris Brezillon)
- API for in-kernel clients (Noralf Trønnes)
- improvements to the path of finding panels(Boris Brezillon)

Driver Changes:
- initial support for the virtual display driver - vkms(Haneen Mohammed and Rodrigo Siqueira)
- panel: add Rocktech RK070ER9427 LCD support (Jagan Teki)
- panel: add support for the EDT ETM0700G0EDH6 and EDT ETM0700G0BDH6(Jan Tuerk)
- panel: add DLC DLC0700YZG-1 (Philipp Zabel)
- panel: add support for BOE HV070WSA-100 (Andrzej Hajda)
- panel: add newhaven, nhd-4.3-480272ef-atxl LCD (Tomi Valkeinen)
- panel: add support for Innolux G070Y2-L01 (Christoph Fritz)
- panel: add support for DataImage SCF0700C48GGU18 (Michal Vokáč)
- panel: add support for Sharp LQ035Q7DB03 (Vladimir Zapolskiy)
- panel: p079zca: Refactor panel driver to support multiple panels (Lin Huang)
- sun4i: Add R40 display engine compatible(Jernej Skrabec)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180712011137.GA26620@juma
2018-07-19 05:27:57 +10:00
Daniel Vetter
7f9e7ec92b drm/doc: Include drm_of.c helpers
Fixes a dead link I spotted in the struct drm_crtc docs. Comments
themselves are in a surprisingly good state.

v2: Fix subject typo (Sean).

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-14-daniel.vetter@ffwll.ch
2018-07-13 18:40:28 +02:00
Daniel Vetter
9bea6dd081 drm/doc: Group the fb gem helpers better
Instead of spreading them all over the place.

Cc: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-13-daniel.vetter@ffwll.ch
2018-07-13 18:40:28 +02:00
Daniel Vetter
268bc24e86 drm: switch drm_plane to inline comments
And use that opportunity to polish the kernel doc all around:
- Beef up some of the documentation.
- Intro text for drm_plane and better links
- Fix all the hyperlinks!

v2: Fix linebreaks.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-10-daniel.vetter@ffwll.ch
2018-07-13 18:40:28 +02:00
Daniel Vetter
cde4c44d87 drm: drop _mode_ from drm_mode_connector_attach_encoder
Again to align with the usual prefix of just drm_connector_. Again
done with sed + manual fixup for indent issues.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-7-daniel.vetter@ffwll.ch
2018-07-13 18:40:27 +02:00
Hans Verkuil
d2e2d26521 drm-kms-helpers.rst: document the DP CEC helpers
Document the Display Port CEC helper functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180711132909.25409-3-hverkuil@xs4all.nl
2018-07-13 17:58:19 +03:00
Noralf Trønnes
c76f0f7cb5 drm: Begin an API for in-kernel clients
This the beginning of an API for in-kernel clients.
First out is a way to get a framebuffer backed by a dumb buffer.

Only GEM drivers are supported.
The original idea of using an exported dma-buf was dropped because it
also creates an anonomous file descriptor which doesn't work when the
buffer is created from a kernel thread. The easy way out is to use
drm_driver.gem_prime_vmap to get the virtual address, which requires a
GEM object. This excludes the vmwgfx driver which is the only non-GEM
driver apart from the legacy ones. A solution for vmwgfx will have to be
worked out later if it wants to support the client API which it probably
will when we have a bootsplash client.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-2-noralf@tronnes.org
2018-07-10 14:51:37 +02:00
Dave Airlie
ba7ca97d73 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next
More features for 4.19:
- Use core pcie functionality rather than duplicating our own for pcie
  gens and lanes
- Scheduler function naming cleanups
- More documentation
- Reworked DC/Powerplay interfaces to improve power savings
- Initial stutter mode support for RV (power feature)
- Vega12 powerplay updates
- GFXOFF fixes
- Misc fixes

Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180705221447.2807-1-alexander.deucher@amd.com
2018-07-10 10:57:08 +10:00
Sonny Jiang
8405cf39e8 drm/amdgpu: update documentation for amdgpu_drv.c
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Acked-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-05 16:40:04 -05:00
Tom St Denis
b374d82dca drm/amd/amdgpu: Add a GPU_LOAD entry to sysfs (v3)
This adds what should be a stable interface to read GPU
load from userspace.

(v2): Fix comments and name of file per recommendations.
(v3): Add chapter to amdgpu.rst as well.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Slava Abramov <slava.abramov@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-05 16:38:26 -05:00
Eric Anholt
2dd4f211e7 drm/v3d: Add missing v3d documentation structure.
This was a failure of "git add" on my part -- we already referenced
the doc from drivers.rst.

Signed-off-by: Eric Anholt <eric@anholt.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703170515.6298-3-eric@anholt.net
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
2018-07-05 11:42:50 -07:00
Daniel Vetter
ba6096311b drm: Fix hdmi connector content type property docs
Apparently didn't get carefully checked.

Fixes: 50525c332b ("drm: content-type property for HDMI connector")
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180702091023.695-1-daniel.vetter@ffwll.ch
2018-07-03 08:58:57 +02:00
Dave Airlie
565c17b5f0 Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next
First feature request for 4.19.  Highlights:
- Add initial amdgpu documentation
- Add initial GPU scheduler documention
- GPU scheduler fixes for dying processes
- Add support for the JPEG engine on VCN
- Switch CI to use powerplay by default
- EDC support for CZ
- More powerplay cleanups
- Misc DC fixes

Signed-off-by: Dave Airlie <airlied@redhat.com>

Link: https://patchwork.freedesktop.org/patch/msgid/20180621161138.3008-1-alexander.deucher@amd.com
2018-06-22 13:19:05 +10:00
Brian Starkey
935774cd71 drm: Add writeback connector type
Writeback connectors represent writeback engines which can write the
CRTC output to a memory framebuffer. Add a writeback connector type and
related support functions.

Drivers should initialize a writeback connector with
drm_writeback_connector_init() which takes care of setting up all the
writeback-specific details on top of the normal functionality of
drm_connector_init().

Writeback connectors have a WRITEBACK_FB_ID property, used to set the
output framebuffer, and a WRITEBACK_PIXEL_FORMATS blob used to expose the
supported writeback formats to userspace.

When a framebuffer is attached to a writeback connector with the
WRITEBACK_FB_ID property, it is used only once (for the commit in which
it was included), and userspace can never read back the value of
WRITEBACK_FB_ID. WRITEBACK_FB_ID can only be set if the connector is
attached to a CRTC.

Changes since v1:
 - Added drm_writeback.c + documentation
 - Added helper to initialize writeback connector in one go
 - Added core checks
 - Squashed into a single commit
 - Dropped the client cap
 - Writeback framebuffers are no longer persistent

Changes since v2:
 Daniel Vetter:
 - Subclass drm_connector to drm_writeback_connector
 - Relax check to allow CRTC to be set without an FB
 - Add some writeback_ prefixes
 - Drop PIXEL_FORMATS_SIZE property, as it was unnecessary
 Gustavo Padovan:
 - Add drm_writeback_job to handle writeback signalling centrally

Changes since v3:
 - Rebased
 - Rename PIXEL_FORMATS -> WRITEBACK_PIXEL_FORMATS

Chances since v4:
 - Embed a drm_encoder inside the drm_writeback_connector to
   reduce the amount of boilerplate code required from the drivers
   that are using it.

Changes since v5:
 - Added Rob Clark's atomic_commit() vfunc to connector helper
   funcs, so that writeback jobs are committed from atomic helpers
 - Updated create_writeback_properties() signature to return an
   error code rather than a boolean false for failure.
 - Free writeback job with the connector state rather than when
   doing the cleanup_work()

Changes since v7:
 - fix extraneous use of out_fence that is only introduced in a
   subsequent patch.

Changes since v8:
 - whitespace changes pull from subsequent patch

Changes since v9:
 - Revert the v6 changes that free the writeback job in the connector
   state cleanup and return to doing it in the cleanup_work() function

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
[rebased and fixed conflicts]
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
[rebased and added atomic_commit() vfunc for writeback jobs]
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/229037/
2018-06-20 15:27:49 +01:00
Michel Dänzer
ab3ec8a1a9 drm/amdgpu: Restore :internal: for amdgpu_vm.c documentation
This was accidentally dropped by the "drm/amdgpu: update documentation
for amdgpu_irq.c v3" change, resulting in the GPUVM documentation body
being included twice in the generated documentation.

Trivial.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:46 -05:00
Alex Deucher
dc85db256d drm/doc: Add amdgpu hwmon/power documentation (v2)
Document the hwmon and power control interfaces exposed
by the amdgpu driver.

v2: use section rather than chapter for now

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:45 -05:00
Slava Abramov
923ff76eb0 drm/amdgpu: update documentation for amdgpu_irq.c v3
Add/update function level documentation and add reference to amdgpu_irq.c
in amdgpu.rst

v2:
Added DOC comment
Added more explanations for amdgpu_hotplug_work_func
Properly formatted unused parameters
Properly formatted return values
Fixed usage of acronyms
More consistent styling

v3:
Removed duplicate "not"
Using '&' to refer to functions and types

Signed-off-by: Slava Abramov <slava.abramov@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:44 -05:00
Andrey Grodzovsky
7fc48e5912 drm/amdgpu: Update function level documentation for GPUVM v3
Add/update function level documentation and add reference to amdgpu_vm.c
in amdgpu.rst

v2:
Fix reference in rst file.
Fix compilation warnings.
Add space between function names and params list where
it's missing.

v3:
Fix some funtion comments.
Add formatted documentation to structs.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:43 -05:00
Christian König
ad7f0b6334 drm/amdgpu: fix documentation of amdgpu_mn.c v2
And wire it up as well.

v2: improve the wording, fix label mismatch

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:43 -05:00
Michel Dänzer
a2d19d66b1 drm/amdgpu: Hook up amdgpu_object.c documentation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:33 -05:00
Michel Dänzer
0152ac1652 drm/amdgpu: Hook up documentation about memory domains
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:32 -05:00
Michel Dänzer
baca30fabd drm/amdgpu: Add documentation for PRIME related code
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:31 -05:00
Michel Dänzer
99fa7ce3a8 drm/doc: Add initial amdgpu driver documentation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:31 -05:00
Michel Dänzer
41f507080e drm/doc: Add a label for the PRIME Buffer Sharing chapter
So that it can be referenced from e.g. DOC comments.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:30 -05:00
Nayan Deshmukh
677e8622a9 drm/doc: add a chapter for gpu scheduler
Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-06-15 12:20:21 -05:00
Stanislav Lisovskiy
50525c332b drm: content-type property for HDMI connector
Added content_type property to drm_connector_state
in order to properly handle external HDMI TV content-type setting.

v2:
 * Moved helper function which attaches content type property
   to the drm core, as was suggested.
   Removed redundant connector state initialization.

v3:
 * Removed caps in drm_content_type_enum_list.
   After some discussion it turned out that HDMI Spec 1.4
   was wrongly assuming that IT Content(itc) bit doesn't affect
   Content type states, however itc bit needs to be manupulated
   as well. In order to not expose additional property for itc,
   for sake of simplicity it was decided to bind those together
   in same "content type" property.

v4:
 * Added it_content checking in intel_digital_connector_atomic_check.
   Fixed documentation for new content type enum.

v5:
 * Moved patch revision's description to commit messages.

v6:
 * Minor naming fix for the content type enumeration string.

v7:
 * Fix parameter name for documentation and parameter alignment
   in order not to get warning. Added Content Type description to
   new HDMI connector properties section.

v8:
 * Thrown away unneeded numbers from HDMI content-type property
   description. Switch to strings desription instead of plain
   definitions.

v9:
 * Moved away hdmi specific content-type enum from
   drm_connector_state. Content type property should probably not
   be bound to any specific connector interface in
   drm_connector_state.
   Same probably should be done to hdmi_picture_aspect_ration enum
   which is also contained in drm_connector_state. Added special
   helper function to get derive hdmi specific relevant infoframe
   fields.

v10:
 * Added usage description to HDMI properties kernel doc.

v11:
 * Created centralized function for filling HDMI AVI infoframe, based
   on correspondent DRM property value.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180515135928.31092-2-stanislav.lisovskiy@intel.com
[vsyrjala: clean up checkpatch multiple blank lines warnings]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-05-17 18:58:35 +03:00
Maarten Lankhorst
94cc2fde36 Merge remote-tracking branch 'drm/drm-next' into drm-misc-next
drm-misc-next is still based on v4.16-rc7, and was getting a bit stale.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-05-11 18:08:10 +02:00
Dave Airlie
8eb008c808 First drm/i915 feature batch heading for v4.18:
- drm-next backmerge to fix build (Rodrigo)
 - GPU documentation improvements (Kevin)
 - GuC and HuC refactoring, host/GuC communication, logging, fixes, and more
   (mostly Michal and Michał, also Jackie, Michel and Piotr)
 - PSR and PSR2 enabling and fixes (DK, José, Rodrigo and Chris)
 - Selftest updates (Chris, Daniele)
 - DPLL management refactoring (Lucas)
 - DP MST fixes (Lyude and DK)
 - Watermark refactoring and changes to support NV12 (Mahesh)
 - NV12 prep work (Chandra)
 - Icelake Combo PHY enablers (Manasi)
 - Perf OA refactoring and ICL enabling (Lionel)
 - ICL enabling (Oscar, Paulo, Nabendu, Mika, Kelvin, Michel)
 - Workarounds refactoring (Oscar)
 - HDCP fixes and improvements (Ramalingam, Radhakrishna)
 - Power management fixes (Imre)
 - Various display fixes (Maarten, Ville, Vidya, Jani, Gaurav)
 - debugfs for FIFO underrun clearing (Maarten)
 - Execlist improvements (Chris)
 - Reset improvements (Chris)
 - Plenty of things here and there I overlooked and/or didn't understand... (Everyone)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEFWWmW3ewYy4RJOWc05gHnSar7m8FAlrQokEACgkQ05gHnSar
 7m+Y0w//Y+I4AsqJcmkcNuE+H3IAzK9Dw3noh8+biV4O1tJCR+obTdS3JifAPF98
 wRwsYjV3mgZRgGn6seTEUD9cgT5uLkYLfMWuO4SsxJr85bBgV4N2OXBMaU7Hw/WO
 lPrMHfvG6vIt4ZiLlxuS3SzH7+QTvPtIS3caRAIlcLL917gmkmGvqCB4XkznAG4D
 b4G07JJoasRozPP9SljwvTDKrcsY/ehPeBpU1N7iGIG3eXMgLjunt/QdNU+dA0tr
 mk6tHkV7zUnI+Y4is7QHnnhem299tYY/WWtaHEhRCe2qJRw/e+o7mfsiwmIENEUe
 7K7Zi+x78gIwPxTR2QefphQA2JLZKUOGJHzVy2bAkIhfwf5bJw/qmUdfGEVNCe9r
 EAllcreqvHZI8eqaqABC+5zgOozzy07+jWoD3K/5FGLDeSZTvfL4NQk91x06C84C
 yT9lvamvZBHUXYh715d3DEhZg4UwbZLTZQjJLDn8yQ/Rw5NSuaD5GlHiopner1j/
 lxZakbEHiuTdrHtk4JEho/fup1dE3uYuAQJyAjVYdZm5IVxWQW67XZxep0vwQdN5
 K4oGh02Npn3/G3KUFS6kud67P5yzccx+xqu8Ey6Lc7e3yF0FuxsM9OXEL3l18fJB
 tg17jThrALhONh7s0byyW0Kt/AHIrK2YLSj0xPzzlOVA8m2W/tw=
 =beK0
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-next-2018-04-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

First drm/i915 feature batch heading for v4.18:

- drm-next backmerge to fix build (Rodrigo)
- GPU documentation improvements (Kevin)
- GuC and HuC refactoring, host/GuC communication, logging, fixes, and more
  (mostly Michal and Michał, also Jackie, Michel and Piotr)
- PSR and PSR2 enabling and fixes (DK, José, Rodrigo and Chris)
- Selftest updates (Chris, Daniele)
- DPLL management refactoring (Lucas)
- DP MST fixes (Lyude and DK)
- Watermark refactoring and changes to support NV12 (Mahesh)
- NV12 prep work (Chandra)
- Icelake Combo PHY enablers (Manasi)
- Perf OA refactoring and ICL enabling (Lionel)
- ICL enabling (Oscar, Paulo, Nabendu, Mika, Kelvin, Michel)
- Workarounds refactoring (Oscar)
- HDCP fixes and improvements (Ramalingam, Radhakrishna)
- Power management fixes (Imre)
- Various display fixes (Maarten, Ville, Vidya, Jani, Gaurav)
- debugfs for FIFO underrun clearing (Maarten)
- Execlist improvements (Chris)
- Reset improvements (Chris)
- Plenty of things here and there I overlooked and/or didn't understand... (Everyone)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87lgd2cze8.fsf@intel.com
2018-05-04 10:32:21 +10:00