aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-05-17 22:57:06 -0400
committerDave Airlie <airlied@redhat.com>2017-05-17 22:57:06 -0400
commite98c58e55f68f8785aebfab1f8c9a03d8de0afe1 (patch)
tree8357e8fda6efb0867ac39fc6b9211a579721d00a /drivers/gpu/drm/amd/amdgpu
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
parent9cf8f5802f39d9991158b29033c852bccfc3a4d4 (diff)
Merge tag 'drm-misc-next-2017-05-16' of git://anongit.freedesktop.org/git/drm-misc into drm-next
UAPI Changes: - Return -ENODEV instead of -ENXIO when creating cma fb w/o valid gem (Daniel) - Add aspect ratio and custom scaling propertis to connector state (Maarten) Cross-subsystem Changes: - None Core Changes: - Add Laurent as bridge reviewer and Andrzej as bridge maintainer (Archit) - Maintain new STM driver through -misc (Yannick) - Misc doc improvements (as is tradition) (Daniel) - Add driver-private objects to atomic state (Dhinakaran) - Deprecate preclose hook in modern drivers (use postclose) (Daniel) - Add hwmode to vblank struct. This fixes mode access in irq context and reduced a bunch of boilerplate (Daniel) Driver Changes: - vc4: Add out-fence support to vc4 V3D rendering (Eric) - stm: Add stm32f429 display hw and am-480272h3tmqw-t01h panel support (Yannick) - vc4: Remove 256MB cma limit from vc4 (Eric) - dw-hdmi: Disable audio when inactive, instead of always enabled (Romain) - zte: Add support for VGA to the ZTE driver (Shawn) - i915: Track DP MST bandwidth and check it in atomic_check (Dhinakaran) - vgem: Enable gem dmabuf import iface to facilitate ion testing (Laura) - vc4: Add support for Cygnus (new dt compat string + couple bug fixes) (Eric) - pl111: Add driver for pl111 CLCD display controller (Eric/Tom) - vgem: Subclass drm_device instead of standalone platform device (Chris) Cc: Archit Taneja <architt@codeaurora.org> Cc: Eric Anholt <eric@anholt.net> Cc: Yannick Fertre <yannick.fertre@st.com> Cc: Romain Perier <romain.perier@collabora.com> Cc: Navare, Manasi D <manasi.d.navare@intel.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Laura Abbott <labbott@redhat.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Tom Cooksey <tom.cooksey@arm.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> * tag 'drm-misc-next-2017-05-16' of git://anongit.freedesktop.org/git/drm-misc: (72 commits) drm: add missing declaration to drm_blend.h drm/dp: Wait up all outstanding tx waiters drm/dp: Read the tx msg state once after checking for an event drm/prime: Forward declare struct device drm/vblank: Lock down vblank->hwmode more drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos drm/vblank: Add FIXME comments about moving the vblank ts hooks drm/vblank: Switch to bool in_vblank_irq in get_vblank_timestamp drm/vblank: Switch drm_driver->get_vblank_timestamp to return a bool drm/vgem: Convert to a struct drm_device subclass gpu: drm: gma500: remove dead code drm/sti: Adjust two checks for null pointers in sti_hqvdp_probe() drm/sti: Fix typos in a comment line drm/sti: Fix a typo in a comment line drm/sti: Replace 17 seq_puts() calls by seq_putc() drm/sti: Reduce function calls for sequence output at five places drm/sti: use seq_puts to display a string drm: Nerf the preclose callback for modern drivers drm/exynos: Merge pre/postclose hooks drm/tegra: switch to postclose ...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c14
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c41
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h3
4 files changed, 15 insertions, 47 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 833c3c16501a..67cdab9241a4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1912,10 +1912,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon);
1912u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); 1912u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe);
1913int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe); 1913int amdgpu_enable_vblank_kms(struct drm_device *dev, unsigned int pipe);
1914void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); 1914void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe);
1915int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe,
1916 int *max_error,
1917 struct timeval *vblank_time,
1918 unsigned flags);
1919long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, 1915long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd,
1920 unsigned long arg); 1916 unsigned long arg);
1921 1917
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index f2d705e6a75a..5cb8f3e68447 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -715,6 +715,16 @@ static const struct file_operations amdgpu_driver_kms_fops = {
715#endif 715#endif
716}; 716};
717 717
718static bool
719amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
720 bool in_vblank_irq, int *vpos, int *hpos,
721 ktime_t *stime, ktime_t *etime,
722 const struct drm_display_mode *mode)
723{
724 return amdgpu_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos,
725 stime, etime, mode);
726}
727
718static struct drm_driver kms_driver = { 728static struct drm_driver kms_driver = {
719 .driver_features = 729 .driver_features =
720 DRIVER_USE_AGP | 730 DRIVER_USE_AGP |
@@ -729,8 +739,8 @@ static struct drm_driver kms_driver = {
729 .get_vblank_counter = amdgpu_get_vblank_counter_kms, 739 .get_vblank_counter = amdgpu_get_vblank_counter_kms,
730 .enable_vblank = amdgpu_enable_vblank_kms, 740 .enable_vblank = amdgpu_enable_vblank_kms,
731 .disable_vblank = amdgpu_disable_vblank_kms, 741 .disable_vblank = amdgpu_disable_vblank_kms,
732 .get_vblank_timestamp = amdgpu_get_vblank_timestamp_kms, 742 .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
733 .get_scanout_position = amdgpu_get_crtc_scanoutpos, 743 .get_scanout_position = amdgpu_get_crtc_scanout_position,
734#if defined(CONFIG_DEBUG_FS) 744#if defined(CONFIG_DEBUG_FS)
735 .debugfs_init = amdgpu_debugfs_init, 745 .debugfs_init = amdgpu_debugfs_init,
736#endif 746#endif
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 96c341670782..dca4be970d13 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -945,47 +945,6 @@ void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe)
945 amdgpu_irq_put(adev, &adev->crtc_irq, idx); 945 amdgpu_irq_put(adev, &adev->crtc_irq, idx);
946} 946}
947 947
948/**
949 * amdgpu_get_vblank_timestamp_kms - get vblank timestamp
950 *
951 * @dev: drm dev pointer
952 * @crtc: crtc to get the timestamp for
953 * @max_error: max error
954 * @vblank_time: time value
955 * @flags: flags passed to the driver
956 *
957 * Gets the timestamp on the requested crtc based on the
958 * scanout position. (all asics).
959 * Returns postive status flags on success, negative error on failure.
960 */
961int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe,
962 int *max_error,
963 struct timeval *vblank_time,
964 unsigned flags)
965{
966 struct drm_crtc *crtc;
967 struct amdgpu_device *adev = dev->dev_private;
968
969 if (pipe >= dev->num_crtcs) {
970 DRM_ERROR("Invalid crtc %u\n", pipe);
971 return -EINVAL;
972 }
973
974 /* Get associated drm_crtc: */
975 crtc = &adev->mode_info.crtcs[pipe]->base;
976 if (!crtc) {
977 /* This can occur on driver load if some component fails to
978 * initialize completely and driver is unloaded */
979 DRM_ERROR("Uninitialized crtc %d\n", pipe);
980 return -EINVAL;
981 }
982
983 /* Helper routine in DRM core does all the work: */
984 return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error,
985 vblank_time, flags,
986 &crtc->hwmode);
987}
988
989const struct drm_ioctl_desc amdgpu_ioctls_kms[] = { 948const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
990 DRM_IOCTL_DEF_DRV(AMDGPU_GEM_CREATE, amdgpu_gem_create_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), 949 DRM_IOCTL_DEF_DRV(AMDGPU_GEM_CREATE, amdgpu_gem_create_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
991 DRM_IOCTL_DEF_DRV(AMDGPU_CTX, amdgpu_ctx_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), 950 DRM_IOCTL_DEF_DRV(AMDGPU_CTX, amdgpu_ctx_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
index dbd10618ec20..43a9d3aec6c4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
@@ -534,6 +534,9 @@ struct amdgpu_framebuffer {
534 ((em) == ATOM_ENCODER_MODE_DP_MST)) 534 ((em) == ATOM_ENCODER_MODE_DP_MST))
535 535
536/* Driver internal use only flags of amdgpu_get_crtc_scanoutpos() */ 536/* Driver internal use only flags of amdgpu_get_crtc_scanoutpos() */
537#define DRM_SCANOUTPOS_VALID (1 << 0)
538#define DRM_SCANOUTPOS_IN_VBLANK (1 << 1)
539#define DRM_SCANOUTPOS_ACCURATE (1 << 2)
537#define USE_REAL_VBLANKSTART (1 << 30) 540#define USE_REAL_VBLANKSTART (1 << 30)
538#define GET_DISTANCE_TO_VBLANKSTART (1 << 31) 541#define GET_DISTANCE_TO_VBLANKSTART (1 << 31)
539 542