[Bug 109001] Freezes when waking up after screen goes blank.

2018-12-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=109001

--- Comment #9 from Matt Garman  ---
I too am having the same problem.  After the screen blanks, the system is
barely usable: pauses/freezes randomly.  If I switch to a virtual (text)
console, everything works as expected.  Switching back to X usually causes X to
crash, kicking me back to the login screen.  Usually after I re-login, the
pauses are gone.  Sometimes it takes a second try.  Every now and then, though,
the pausing/freezing won't go away, and a reboot is required.

I am using Manjaro, which is based on Arch, so fairly similar to the original
poster.  Kernel 4.19.12-2-MANJARO.

In addition to the error log lines already reported:

[32952.381123] [drm:dm_vblank_get_counter [amdgpu]] *ERROR* dc_stream_state is
NULL for crtc '1'!
[32952.381201] [drm:dm_crtc_get_scanoutpos [amdgpu]] *ERROR* dc_stream_state is
NULL for crtc '1'!

I also have the following kernel trace in dmesg:

[24708.647186] WARNING: CPU: 2 PID: 638 at
drivers/gpu/drm/amd/amdgpu/../display/dc/core/
dc_link.c:1570 core_link_enable_stream+0x657/0xb90 [amdgpu]
[24708.647187] Modules linked in: iptable_mangle xt_CHECKSUM iptable_nat
ipt_MASQUERADE n
f_nat_ipv4 nf_nat xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4
libcrc32c ipt_R
EJECT nf_reject_ipv4 xt_tcpudp tun bridge stp llc devlink ebtable_filter
ebtables ip6tabl
e_filter ip6_tables iptable_filter rpcsec_gss_krb5 auth_rpcgss nfsv4
dns_resolver nfs loc
kd grace sunrpc fscache cmac bnep nct6775 hwmon_vid amdkfd amd_iommu_v2 amdgpu
arc4 iwlmv
m edac_mce_amd snd_hda_codec_hdmi kvm_amd snd_hda_intel ccp mac80211 rng_core
kvm snd_hda
_codec btusb chash btrtl gpu_sched btbcm fuse irqbypass ttm snd_hda_core
btintel snd_hwde
p iwlwifi crct10dif_pclmul drm_kms_helper crc32_pclmul bluetooth snd_pcm
ghash_clmulni_in
tel pcbc drm snd_timer mousedev cfg80211 igb agpgart syscopyarea sysfillrect
aesni_intel
wmi_bmof
[24708.647214]  ecdh_generic snd sysimgblt aes_x86_64 i2c_algo_bit crypto_simd
cryptd inp
ut_leds glue_helper fb_sys_fops soundcore dca rfkill pcspkr sp5100_tco
i2c_piix4 k10temp
wmi evdev mac_hid gpio_amdpt pinctrl_amd pcc_cpufreq acpi_cpufreq sg
crypto_user ip_table
s x_tables ext4 crc32c_generic crc16 mbcache jbd2 fscrypto sr_mod cdrom sd_mod
hid_generi
c usbhid hid ahci libahci libata xhci_pci scsi_mod xhci_hcd crc32c_intel
[24708.647233] CPU: 2 PID: 638 Comm: Xorg Tainted: GW
4.19.12-2-MANJARO #
1
[24708.647234] Hardware name: To Be Filled By O.E.M. To Be Filled By
O.E.M./AB350 Gaming-
ITX/ac, BIOS P5.30 12/18/2018
[24708.647268] RIP: 0010:core_link_enable_stream+0x657/0xb90 [amdgpu]
[24708.647270] Code: e8 b9 02 00 00 00 48 8d 54 24 58 44 89 ee 48 89 df 45 0f
b6 74 24 01 44 88 7c 24 58 44 88 74 24 59 e8 9d dd ff ff 84 c0 75 02 <0f> 0b 41
8d 47 f6 3c 02 77 b5 41 80 ff 0a 0f 85 2c 03 00 00 44 88
[24708.647271] RSP: 0018:b75a43e578d8 EFLAGS: 00010246
[24708.647272] RAX:  RBX: 9496df3b4188 RCX:

[24708.647273] RDX: 01d5f402 RSI: 9498108a70c0 RDI:
949810407600
[24708.647274] RBP: b75a43e5791c R08: 000270c0 R09:
c0e7803d
[24708.647274] R10: e0670974f400 R11: b75a43e57720 R12:
b75a43e5791a
[24708.647275] R13: 005e R14: 004c R15:
000c
[24708.647276] FS:  7f03c1ad5e00() GS:94981088()
knlGS:
[24708.647277] CS:  0010 DS:  ES:  CR0: 80050033
[24708.647278] CR2: 7f75a1af47a0 CR3: 00038c548000 CR4:
003406e0
[24708.647278] Call Trace:
[24708.647320]  dce110_apply_ctx_to_hw+0x63f/0x650 [amdgpu]
[24708.647355]  dc_commit_state+0x2c6/0x520 [amdgpu]
[24708.647383]  ? set_freesync_on_streams.part.6+0x4d/0x250 [amdgpu]
[24708.647410]  ? mod_freesync_set_user_enable+0x11f/0x150 [amdgpu]
[24708.647439]  amdgpu_dm_atomic_commit_tail+0x388/0xdb0 [amdgpu]
[24708.647441]  ? _raw_spin_lock_irq+0x1a/0x40
[24708.647442]  ? _raw_spin_unlock_irq+0x1d/0x30
[24708.647443]  ? wait_for_common+0x113/0x190
[24708.647444]  ? _raw_spin_unlock_irq+0x1d/0x30
[24708.647445]  ? wait_for_common+0x113/0x190
[24708.647450]  commit_tail+0x3d/0x70 [drm_kms_helper]
[24708.647454]  drm_atomic_helper_commit+0x103/0x110 [drm_kms_helper]
[24708.647458]  drm_atomic_helper_set_config+0x80/0x90 [drm_kms_helper]
[24708.647466]  drm_mode_setcrtc+0x187/0x6b0 [drm]
[24708.647468]  ? __switch_to_asm+0x34/0x70
[24708.647469]  ? __switch_to_asm+0x40/0x70
[24708.647470]  ? __switch_to_asm+0x34/0x70
[24708.647470]  ? __switch_to_asm+0x40/0x70
[24708.647476]  ? drm_mode_getcrtc+0x180/0x180 [drm]
[24708.647482]  drm_ioctl_kernel+0xa7/0xf0 [drm]
[24708.647488]  drm_ioctl+0x30e/0x3c0 [drm]
[24708.647494]  ? drm_mode_getcrtc+0x180/0x180 [drm]
[24708.647512]  amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
[24708.647514]  do_vfs_ioctl+0xa4/0x630
[24708.647516]  ? syscall_slow_exit_work+0x19b/0x1b0
[24708.647517]  ksys_ioctl+0x60/0x90
[24708.647518]  __x64_sys_ioctl+0x16/0x20
[24708.647520]  

[Bug 108781] 4.19 Regression - Hawaii (R9 390) boot failure - Invalid PCC GPIO / invalid powerlevel state / Fatal error during GPU init

2018-12-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=108781

--- Comment #36 from danglingpointerexcept...@gmail.com ---
I was getting similar unusable issues as everyone with 4.19.x with my R9-290X
so I decided to wait for 4.20

I installed 4.20.0 to see if the problem has been resolved but it has changed
to a different problem; it only renders one monitor and cannot detect the
monitor types.
Only one DVI and one HDMI port works, all the rest don't and show black
screens.
Using the only two ports that actually output a signal forces the two monitors
to mirror.  
Going into display settings to identify monitors shows only 1 monitor hardware
detected and I am unable to identify monitors.
Rebooting doesn't fix problem.
Cold boot doesn't fix problem.
These problems do NOT exist with Linux Kernel 4.18.20.  It just worked.

I would really appreciate a resolution to this with future Kernels 4.20.x!  I'm
switching back to Linux Kernel 4.18.20.

# Kernel and command line
---
kernel: Linux version 4.20.0-042000-generic (kernel@tangerine) (gcc version
8.2.0 (Ubuntu 8.2.0-12ubuntu1)) #201812232030 SMP Mon Dec 24 01:32:58 UTC 2018
kernel: Command line: BOOT_IMAGE=/vmlinuz-4.20.0-042000-generic
root=/dev/mapper/ubuntu--vg-root ro quiet splash radeon.si_support=0
radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.dc=1


# "lspci -v" for Linux Kernel 4.20.0
---
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
Hawaii XT / Grenada XT [Radeon R9 290X/390X] (prog-if 00 [VGA controller])
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT / Grenada
XT [Radeon R9 290X/390X]
Flags: fast devsel, IRQ 16
Memory at d000 (64-bit, prefetchable) [size=256M]
Memory at ef80 (64-bit, prefetchable) [size=8M]
I/O ports at ae00 [size=256]
Memory at fb98 (32-bit, non-prefetchable) [size=256K]
[virtual] Expansion ROM at 000c [disabled] [size=128K]
Capabilities: [48] Vendor Specific Information: Len=08 
Capabilities: [50] Power Management version 3
Capabilities: [58] Express Legacy Endpoint, MSI 00
Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010

Capabilities: [150] Advanced Error Reporting
Capabilities: [270] #19
Capabilities: [2b0] Address Translation Service (ATS)
Capabilities: [2c0] Page Request Interface (PRI)
Capabilities: [2d0] Process Address Space ID (PASID)
Kernel modules: radeon, amdgpu

01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii HDMI Audio
[Radeon R9 290/290X / 390/390X]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii HDMI Audio
[Radeon R9 290/290X / 390/390X]
Flags: bus master, fast devsel, latency 0, IRQ 32
Memory at fb9fc000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [48] Vendor Specific Information: Len=08 
Capabilities: [50] Power Management version 3
Capabilities: [58] Express Legacy Endpoint, MSI 00
Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010

Capabilities: [150] Advanced Error Reporting
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel


# "journalctl -b | grep drm" output for last boot Kernel 4.20 only one display
working. Other display forced mirroring. Other GPU ports not working.
---
[drm] amdgpu kernel modesetting enabled.
[drm] initializing kernel modesetting (HAWAII 0x1002:0x67B0 0x1002:0x0B00
0x00).
[drm] register mmio base: 0xFB98
[drm] register mmio size: 262144
[drm] add ip block number 0 
[drm] add ip block number 1 
[drm] add ip block number 2 
[drm] add ip block number 3 
[drm] add ip block number 4 
[drm] add ip block number 5 
[drm] add ip block number 6 
[drm] add ip block number 7 
[drm] add ip block number 8 
[drm] vm size is 128 GB, 2 levels, block size is 10-bit, fragment size is 9-bit
[drm:gmc_v7_0_sw_init [amdgpu]] *ERROR* Failed to load mc firmware!
[drm:amdgpu_device_init.cold.31 [amdgpu]] *ERROR* sw_init of IP block
 failed -2
[drm] amdgpu: finishing device.


# "journalctl | grep drm" output for last SUCCESSFUL boot of linux Kernel
4.18.20. All displays working. Everything worked ok. Here for reference
---
[drm] amdgpu kernel modesetting enabled.
fb: switching to amdgpudrmfb from VESA VGA
[drm] initializing kernel modesetting (HAWAII 0x1002:0x67B0 0x1002:0x0B00
0x00).
[drm] register mmio base: 0xFB98
[drm] register mmio size: 262144
[drm] probing gen 2 caps for device 8086:151 = 261ac83/e
[drm] probing mlw for device 8086:151 = 261ac83
[drm] add ip block number 0 
[drm] add ip block number 1 
[drm] add ip block number 2 
[drm] add ip block number 3 
[drm] add ip block number 4 
[drm] add ip 

Re: [PATCH v2 0/14] drm: minimize drmP.h dependencies

2018-12-30 Thread Sam Ravnborg
> Hi Sam,
> 
> And the $subjects that say "reply" should say "rely" I think.
Yep, fixed. Will be part of v3.

Thanks,

Sam

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 201815] Mouse Pointer Disappears when touching top of the screen

2018-12-30 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=201815

siyia (eutychio...@gmail.com) changed:

   What|Removed |Added

 Kernel Version|4.20rc3-rc5 |4.20

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 201815] Mouse Pointer Disappears when touching top of the screen

2018-12-30 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=201815

--- Comment #9 from siyia (eutychio...@gmail.com) ---
tried both wayland and xorg on kde

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 201815] Mouse Pointer Disappears when touching top of the screen

2018-12-30 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=201815

--- Comment #8 from siyia (eutychio...@gmail.com) ---
Hello issue persists on latest kernel 4.20 stable

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 03/11] vga-switcheroo: make PCI dependency explicit

2018-12-30 Thread Sinan Kaya
This driver depends on the PCI infrastructure but the dependency has not
been explicitly called out.

Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set")
Signed-off-by: Sinan Kaya 
Reviewed-by: Lukas Wunner 
Acked-by: Daniel Vetter 
---
 drivers/gpu/vga/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/vga/Kconfig b/drivers/gpu/vga/Kconfig
index b677e5d524e6..d5f1d8e1c6f8 100644
--- a/drivers/gpu/vga/Kconfig
+++ b/drivers/gpu/vga/Kconfig
@@ -21,6 +21,7 @@ config VGA_SWITCHEROO
bool "Laptop Hybrid Graphics - GPU switching support"
depends on X86
depends on ACPI
+   depends on PCI
select VGA_ARB
help
  Many laptops released in 2008/9/10 have two GPUs with a multiplexer
-- 
2.19.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] drm: forward declare struct drm_file in drm_syncobj.h

2018-12-30 Thread Laurent Pinchart
Hi Jani,

Thank you for the patch.

On Friday, 28 December 2018 10:28:15 EET Jani Nikula wrote:
> Make it easier to drop drmP.h includes. Switch from "" to <> includes
> while at it.
> 
> v2: forward declare instead of including drm_file.h (Daniel)

Reviewed-by: Laurent Pinchart 

but with the same comments as for the previous patches.

> Cc: Sam Ravnborg 
> Cc: Daniel Vetter 
> Cc: Laurent Pinchart 
> Reviewed-by: Daniel Vetter 
> Signed-off-by: Jani Nikula 
> ---
>  include/drm/drm_syncobj.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
> index 7c6ed845c70d..0311c9fdbd2f 100644
> --- a/include/drm/drm_syncobj.h
> +++ b/include/drm/drm_syncobj.h
> @@ -26,7 +26,9 @@
>  #ifndef __DRM_SYNCOBJ_H__
>  #define __DRM_SYNCOBJ_H__
> 
> -#include "linux/dma-fence.h"
> +#include 
> +
> +struct drm_file;
> 
>  /**
>   * struct drm_syncobj - sync object.

-- 
Regards,

Laurent Pinchart



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 4/6] drm: include types.h from drm_hdcp.h

2018-12-30 Thread Laurent Pinchart
Hi Jani,

Thank you for the patch.

On Thursday, 27 December 2018 14:56:39 EET Jani Nikula wrote:
> Make it easier to drop drmP.h includes.

Same comment as for the previous patches, let's explain the reason.

"drm_hdcp.h uses kernel integer types, make it self-contained by including 
linux/kernel.h. This prepares for dropping drmP.h from files including 
drm_hdcp.h."

Reviewed-by: Laurent Pinchart 

> Cc: Sam Ravnborg 
> Cc: Daniel Vetter 
> Cc: Laurent Pinchart 
> Signed-off-by: Jani Nikula 
> ---
>  include/drm/drm_hdcp.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
> index a6de09c5e47f..d6dfef8cff6a 100644
> --- a/include/drm/drm_hdcp.h
> +++ b/include/drm/drm_hdcp.h
> @@ -9,6 +9,8 @@
>  #ifndef _DRM_HDCP_H_INCLUDED_
>  #define _DRM_HDCP_H_INCLUDED_
> 
> +#include 
> +
>  /* Period of hdcp checks (to ensure we're still authenticated) */
>  #define DRM_HDCP_CHECK_PERIOD_MS (128 * 16)

-- 
Regards,

Laurent Pinchart



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 0/14] drm: minimize drmP.h dependencies

2018-12-30 Thread Sam Ravnborg
On Sun, Dec 30, 2018 at 06:48:24PM +0100, Sam Ravnborg wrote:
> The goal with this small series

The series should have been a reply to this cover letter,
but my tooling lost me - sorry!

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/6] drm: include idr.h from drm_file.h

2018-12-30 Thread Laurent Pinchart
Hi Jani,

Thank you for the patch.

On Thursday, 27 December 2018 14:56:38 EET Jani Nikula wrote:
> Make it easier to drop drmP.h includes.

How about explaining why idr.h is needed ?

"drm_file.h embeds idr structures in DRM-specific structures. Include the 
corresponding header to make drm_file.h self-contained."

Reviewed-by: Laurent Pinchart 

> Cc: Sam Ravnborg 
> Cc: Daniel Vetter 
> Cc: Laurent Pinchart 
> Signed-off-by: Jani Nikula 
> ---
>  include/drm/drm_file.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index 84ac79219e4c..6710b612e2f6 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -32,6 +32,7 @@
> 
>  #include 
>  #include 
> +#include 
> 
>  #include 

-- 
Regards,

Laurent Pinchart



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] drm: un-inline drm_legacy_findmap()

2018-12-30 Thread Laurent Pinchart
Hi Jani,

Thank you for the patch.

On Friday, 28 December 2018 15:04:46 EET Jani Nikula wrote:
> Also include drm_hashtab.h and add struct drm_device forward declaration
> in drm_legacy.h to make it more self-contained. Make it easier to drop
> drmP.h includes.
> 
> v2: avoid including drm_device.h by un-inlining (Daniel)

It would be nice to explain why you de-inline the function (I assume because 
it's a bit too large).

Reviewed-by: Laurent Pinchart 

> Cc: Sam Ravnborg 
> Cc: Daniel Vetter 
> Cc: Laurent Pinchart 
> Signed-off-by: Jani Nikula 
> ---
>  drivers/gpu/drm/drm_bufs.c | 11 +++
>  include/drm/drm_legacy.h   | 14 --
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
> index d7d10cabb9bb..a39ab2193bfe 100644
> --- a/drivers/gpu/drm/drm_bufs.c
> +++ b/drivers/gpu/drm/drm_bufs.c
> @@ -377,6 +377,17 @@ int drm_legacy_addmap(struct drm_device *dev,
> resource_size_t offset, }
>  EXPORT_SYMBOL(drm_legacy_addmap);
> 
> +struct drm_local_map *drm_legacy_findmap(struct drm_device *dev,
> +  unsigned int token)
> +{
> + struct drm_map_list *_entry;
> + list_for_each_entry(_entry, >maplist, head)
> + if (_entry->user_token == token)
> + return _entry->map;
> + return NULL;
> +}
> +EXPORT_SYMBOL(drm_legacy_findmap);
> +
>  /**
>   * Ioctl to specify a range of memory that is available for mapping by a
>   * non-root process.
> diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
> index 8fad66f88e4f..3e99ab69c122 100644
> --- a/include/drm/drm_legacy.h
> +++ b/include/drm/drm_legacy.h
> @@ -2,6 +2,9 @@
>  #define __DRM_DRM_LEGACY_H__
> 
>  #include 
> +#include 
> +
> +struct drm_device;
> 
>  /*
>   * Legacy driver interfaces for the Direct Rendering Manager
> @@ -156,6 +159,7 @@ struct drm_map_list {
>  int drm_legacy_addmap(struct drm_device *d, resource_size_t offset,
> unsigned int size, enum drm_map_type type,
> enum drm_map_flags flags, struct drm_local_map **map_p);
> +struct drm_local_map *drm_legacy_findmap(struct drm_device *dev, unsigned
> int token); void drm_legacy_rmmap(struct drm_device *d, struct
> drm_local_map *map); int drm_legacy_rmmap_locked(struct drm_device *d,
> struct drm_local_map *map); void drm_legacy_master_rmmaps(struct drm_device
> *dev,
> @@ -194,14 +198,4 @@ void drm_legacy_ioremap(struct drm_local_map *map,
> struct drm_device *dev); void drm_legacy_ioremap_wc(struct drm_local_map
> *map, struct drm_device *dev); void drm_legacy_ioremapfree(struct
> drm_local_map *map, struct drm_device *dev);
> 
> -static inline struct drm_local_map *drm_legacy_findmap(struct drm_device
> *dev, -  unsigned int 
> token)
> -{
> - struct drm_map_list *_entry;
> - list_for_each_entry(_entry, >maplist, head)
> - if (_entry->user_token == token)
> - return _entry->map;
> - return NULL;
> -}
> -
>  #endif /* __DRM_DRM_LEGACY_H__ */


-- 
Regards,

Laurent Pinchart



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 10/14] drm: remove include of drmP.h from drm_modeset_helper.h

2018-12-30 Thread Sam Ravnborg
drmP.h is an relic from the days when there was a single header file.
To enable the removal of drmP.h from all users drop include
of drmP.h from drm_modeset_helper.h.

A few files relied on the file included in drmP.h - add explicit
include statements to these files.
Build tested with arm and x86.

v2:
- Add forward declarations to drm_modeset_helper.h (Laurent Pinchart)

Signed-off-by: Sam Ravnborg 
Reviewed-by: Laurent Pinchart 
Cc: Alexey Brodkin 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Archit Taneja 
Cc: Andrzej Hajda 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: Kieran Bingham 
---
 drivers/gpu/drm/arc/arcpgu_sim.c | 1 +
 drivers/gpu/drm/bridge/cdns-dsi.c| 2 ++
 drivers/gpu/drm/drm_modeset_helper.c | 2 ++
 drivers/gpu/drm/rcar-du/rcar_lvds.c  | 1 +
 include/drm/drm_modeset_helper.h | 6 +-
 5 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c
index 68629e614990..3b7556f62230 100644
--- a/drivers/gpu/drm/arc/arcpgu_sim.c
+++ b/drivers/gpu/drm/arc/arcpgu_sim.c
@@ -14,6 +14,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/bridge/cdns-dsi.c 
b/drivers/gpu/drm/bridge/cdns-dsi.c
index ce9496d13986..4b73d0969468 100644
--- a/drivers/gpu/drm/bridge/cdns-dsi.c
+++ b/drivers/gpu/drm/bridge/cdns-dsi.c
@@ -8,11 +8,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/drm_modeset_helper.c 
b/drivers/gpu/drm/drm_modeset_helper.c
index 9150fa385bba..9bc1ef788c77 100644
--- a/drivers/gpu/drm/drm_modeset_helper.c
+++ b/drivers/gpu/drm/drm_modeset_helper.c
@@ -23,8 +23,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 
 /**
  * DOC: aux kms helpers
diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c 
b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index 534a128a869d..8010ed702509 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/drm/drm_modeset_helper.h b/include/drm/drm_modeset_helper.h
index efa337f03129..995fd981cab0 100644
--- a/include/drm/drm_modeset_helper.h
+++ b/include/drm/drm_modeset_helper.h
@@ -23,7 +23,11 @@
 #ifndef __DRM_KMS_HELPER_H__
 #define __DRM_KMS_HELPER_H__
 
-#include 
+struct drm_crtc;
+struct drm_crtc_funcs;
+struct drm_device;
+struct drm_framebuffer;
+struct drm_mode_fb_cmd2;
 
 void drm_helper_move_panel_connectors_to_head(struct drm_device *);
 
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 14/14] drm: remove drmP.h from drm_gem_cma_helper.h

2018-12-30 Thread Sam Ravnborg
With all dependencies fixed we can now remove
drmP.h from drm_gem_cma_helper.h.
It is replaced by the include files required,
or forward declarations as appropritate.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 include/drm/drm_gem_cma_helper.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 07c504940ba1..947ac95eb24a 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -2,9 +2,12 @@
 #ifndef __DRM_GEM_CMA_HELPER_H__
 #define __DRM_GEM_CMA_HELPER_H__
 
-#include 
+#include 
+#include 
 #include 
 
+struct drm_mode_create_dumb;
+
 /**
  * struct drm_gem_cma_object - GEM object backed by CMA memory allocations
  * @base: base GEM object
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 08/14] drm: remove include of drmP.h from bridge/dw_hdmi.h

2018-12-30 Thread Sam Ravnborg
drmP.h is an relic from the days when there was a single header file.
To enable the removal of drmP.h from all users drop include
of drmP.h from bridge/dw_hdmi.h.

A few files relied on the file included in drmP.h - add explicit
include statements or forward declarations to these files.
Build tested with arm and x86.

v2:
- prefer forward declarations when possible (Laurent Pinchart)
- sort include files (Laurent Pinchart)

Signed-off-by: Sam Ravnborg 
Reviewed-by: Laurent Pinchart 
Cc: Archit Taneja 
Cc: Andrzej Hajda 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Kieran Bingham 
Cc: Fabio Estevam 
Cc: Neil Armstrong 
Cc: Maxime Ripard 
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 4 
 drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c  | 1 +
 include/drm/bridge/dw_hdmi.h| 6 --
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
index 2228689d9a5e..5cbb71a866d5 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
@@ -5,6 +5,10 @@
  * Copyright (c) 2017 Renesas Solutions Corp.
  * Kuninori Morimoto 
  */
+
+#include 
+#include 
+
 #include 
 
 #include 
diff --git a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c 
b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
index 75490a3e0a2a..790d499daa10 100644
--- a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
+++ b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
@@ -7,6 +7,7 @@
  * Contact: Laurent Pinchart (laurent.pinch...@ideasonboard.com)
  */
 
+#include 
 #include 
 #include 
 
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index 9c56412bb2cf..9f93895dde88 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -10,9 +10,11 @@
 #ifndef __DW_HDMI__
 #define __DW_HDMI__
 
-#include 
-
+struct drm_connector;
+struct drm_display_mode;
+struct drm_encoder;
 struct dw_hdmi;
+struct platform_device;
 
 /**
  * DOC: Supported input formats and encodings
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 13/14] drm/tinydrm: do not reply on drmP.h from drm_gem_cma_helper.h

2018-12-30 Thread Sam Ravnborg
drmP.h was the only header file in the past and a lot
of files rely on that drmP.h defines everything.
The goal is to one day to delete drmP.h and
as a step towards this it will no longer be included in the
headers files in include/drm/

To prepare tinydrm/ for this add dependencies that
othwewise was pulled in by drmP.h from drm_gem_cma_helper.h

To avoid that tinydrm.h became "include everything",
push include files to the individual drivers.

Signed-off-by: Sam Ravnborg 
Cc: "Noralf Trønnes" 
Cc: David Airlie 
Cc: Eric Anholt 
Cc: David Lechner 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 3 +++
 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 3 +++
 drivers/gpu/drm/tinydrm/hx8357d.c   | 1 +
 drivers/gpu/drm/tinydrm/ili9225.c   | 2 ++
 drivers/gpu/drm/tinydrm/ili9341.c   | 1 +
 drivers/gpu/drm/tinydrm/mi0283qt.c  | 1 +
 drivers/gpu/drm/tinydrm/mipi-dbi.c  | 3 +++
 drivers/gpu/drm/tinydrm/repaper.c   | 1 +
 drivers/gpu/drm/tinydrm/st7586.c| 1 +
 drivers/gpu/drm/tinydrm/st7735r.c   | 1 +
 10 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c 
b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
index 01a6f2d42440..aeb93eadb047 100644
--- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
+++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
@@ -10,11 +10,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 /**
  * DOC: overview
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c 
b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
index eacfc0ec8ff1..d4576d6e8ce4 100644
--- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
+++ b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
@@ -9,8 +9,11 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 struct tinydrm_connector {
diff --git a/drivers/gpu/drm/tinydrm/hx8357d.c 
b/drivers/gpu/drm/tinydrm/hx8357d.c
index 81a2bbeb25d4..3ae11aa4b73b 100644
--- a/drivers/gpu/drm/tinydrm/hx8357d.c
+++ b/drivers/gpu/drm/tinydrm/hx8357d.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/tinydrm/ili9225.c 
b/drivers/gpu/drm/tinydrm/ili9225.c
index 78f7c2d1b449..b0ad58b97227 100644
--- a/drivers/gpu/drm/tinydrm/ili9225.c
+++ b/drivers/gpu/drm/tinydrm/ili9225.c
@@ -20,7 +20,9 @@
 #include 
 #include 
 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/tinydrm/ili9341.c 
b/drivers/gpu/drm/tinydrm/ili9341.c
index 51395bdc6ca2..bcdf10906ade 100644
--- a/drivers/gpu/drm/tinydrm/ili9341.c
+++ b/drivers/gpu/drm/tinydrm/ili9341.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index 3fa62e77c30b..97805ca37a04 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c 
b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index 3a05e56f9b0d..10294e1283dd 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -10,14 +10,17 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/tinydrm/repaper.c 
b/drivers/gpu/drm/tinydrm/repaper.c
index 54d6fe0f37ce..b2a8f894946a 100644
--- a/drivers/gpu/drm/tinydrm/repaper.c
+++ b/drivers/gpu/drm/tinydrm/repaper.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c
index a6a8a1081b73..bf518167760a 100644
--- a/drivers/gpu/drm/tinydrm/st7586.c
+++ b/drivers/gpu/drm/tinydrm/st7586.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/tinydrm/st7735r.c 
b/drivers/gpu/drm/tinydrm/st7735r.c
index b39779e0dcd8..9bc93d5a0401 100644
--- a/drivers/gpu/drm/tinydrm/st7735r.c
+++ b/drivers/gpu/drm/tinydrm/st7735r.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 09/14] drm: remove include of drmP.h from drm_encoder_slave.h

2018-12-30 Thread Sam Ravnborg
No further changes required.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 include/drm/drm_encoder_slave.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h
index 1107b4b1c599..a09864f6d684 100644
--- a/include/drm/drm_encoder_slave.h
+++ b/include/drm/drm_encoder_slave.h
@@ -27,7 +27,6 @@
 #ifndef __DRM_ENCODER_SLAVE_H__
 #define __DRM_ENCODER_SLAVE_H__
 
-#include 
 #include 
 #include 
 
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 0/14] drm: minimize drmP.h dependencies

2018-12-30 Thread Sam Ravnborg
The goal with this small series is to remove the last bits
that prevents us from removing drmP.h driver-by-driver or file by file.

- drmP.h is now stripped down to include files and forward declarations.
- All header files in include/drm/ no longer include drmP.h.

The series was made on top of drm-misc-next
Build tested using arm and x86 all{yes,mod}config

The patches are trivial but touches a lot of files,
so a lot of people on cc: for the individual patches.

I expect the full series to be applied to drm-misc-next

There are still ~700 uses of drmP.h so a long way ahead of
us to get rid of it.
(The last mail said 900 but that was a typo)

The kernel-doc parts that I authored in the following
may require some extra info as I know too little about
DRM to be able to write something really useful.
Or at least review by someone with knowledge of DRM,
but that goes for everything.

v2:
- DRM_SWITCH_POWER as enum (Daniel Vetter)
- Prefer forward decalration over includes (Laurent Pinchart)
- Updated drm_device to use kerneldoc style (Daniel Vetter)
- Improved commit messages (David Lechner)
- Split up patch when removing drmP.h from drm_gem_cma_helper.h
- rebased on top of drm-misc-next
- dropped patch already applied
- added reviewed-by from Laurent Pinchart (Laurent Pinchart)
- add drm_framebuffer.h patch
- add kernel-doc comments to drm_util.h
- moved EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
- added note to drmP.h not to add new stuff and not to use in new files

Sam


Sam Ravnborg (14):
  drm: drm_device.h: update comments to kerneldoc style
  drm: move DRM_SWITCH_POWER defines to drm_device.h
  drm: make drm_framebuffer.h self contained
  drm: make drm_file.h self contained
  drm: move drm_can_sleep() to drm_util.h
  drm: add kernel-doc comments to drm_util.h
  drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
  drm: remove include of drmP.h from bridge/dw_hdmi.h
  drm: remove include of drmP.h from drm_encoder_slave.h
  drm: remove include of drmP.h from drm_modeset_helper.h
  drm/arc: do not reply on drmP.h from drm_gem_cma_helper.h
  drm/stm: do not reply on drmP.h from drm_gem_cma_helper.h
  drm/tinydrm: do not reply on drmP.h from drm_gem_cma_helper.h
  drm: remove drmP.h from drm_gem_cma_helper.h

 drivers/gpu/drm/amd/amdgpu/atom.c  |   2 +
 drivers/gpu/drm/arc/arcpgu_crtc.c  |   2 +
 drivers/gpu/drm/arc/arcpgu_drv.c   |   6 +
 drivers/gpu/drm/arc/arcpgu_sim.c   |   1 +
 drivers/gpu/drm/ast/ast_fb.c   |   2 +
 drivers/gpu/drm/bridge/cdns-dsi.c  |   2 +
 .../gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c|   4 +
 drivers/gpu/drm/cirrus/cirrus_fbdev.c  |   1 +
 drivers/gpu/drm/drm_flip_work.c|   1 +
 drivers/gpu/drm/drm_framebuffer.c  |   1 +
 drivers/gpu/drm/drm_modeset_helper.c   |   2 +
 drivers/gpu/drm/mgag200/mgag200_fb.c   |   1 +
 drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c   |   1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c   |   1 +
 drivers/gpu/drm/qxl/qxl_cmd.c  |   2 +
 drivers/gpu/drm/radeon/atom.c  |   2 +
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c|   1 +
 drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c |   1 +
 drivers/gpu/drm/rcar-du/rcar_lvds.c|   1 +
 drivers/gpu/drm/stm/drv.c  |   6 +-
 drivers/gpu/drm/stm/ltdc.c |   9 +-
 drivers/gpu/drm/tinydrm/core/tinydrm-core.c|   3 +
 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c|   3 +
 drivers/gpu/drm/tinydrm/hx8357d.c  |   1 +
 drivers/gpu/drm/tinydrm/ili9225.c  |   2 +
 drivers/gpu/drm/tinydrm/ili9341.c  |   1 +
 drivers/gpu/drm/tinydrm/mi0283qt.c |   1 +
 drivers/gpu/drm/tinydrm/mipi-dbi.c |   3 +
 drivers/gpu/drm/tinydrm/repaper.c  |   1 +
 drivers/gpu/drm/tinydrm/st7586.c   |   1 +
 drivers/gpu/drm/tinydrm/st7735r.c  |   1 +
 drivers/gpu/drm/vc4/vc4_drv.h  |   1 +
 include/drm/bridge/dw_hdmi.h   |   6 +-
 include/drm/drmP.h |  24 +--
 include/drm/drm_device.h   | 228 +++--
 include/drm/drm_encoder_slave.h|   1 -
 include/drm/drm_file.h |   1 +
 include/drm/drm_framebuffer.h  |   5 +-
 include/drm/drm_gem_cma_helper.h   |   5 +-
 include/drm/drm_modeset_helper.h   |   6 +-
 include/drm/drm_util.h |  49 -
 41 files changed, 299 insertions(+), 93 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org

[PATCH v2 11/14] drm/arc: do not reply on drmP.h from drm_gem_cma_helper.h

2018-12-30 Thread Sam Ravnborg
drmP.h was the only header file in the past and a lot
of files rely on that drmP.h defines everything.
The goal is to one day to delete drmP.h and
as a step towards this it will no longer be included in the
headers files in include/drm/

To prepare arc/ for this add dependencies that
othwewise was pulled in by drmP.h from drm_gem_cma_helper.h

Signed-off-by: Sam Ravnborg 
Cc: Alexey Brodkin 
Cc: Daniel Vetter 
Cc: David Airlie 
---
 drivers/gpu/drm/arc/arcpgu_crtc.c | 2 ++
 drivers/gpu/drm/arc/arcpgu_drv.c  | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c 
b/drivers/gpu/drm/arc/arcpgu_crtc.c
index 62f51f70606d..155ab177ce0b 100644
--- a/drivers/gpu/drm/arc/arcpgu_crtc.c
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -16,8 +16,10 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 206a76abf771..39a79f5718c4 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -16,12 +16,18 @@
 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
+#include 
 
 #include "arcpgu.h"
 #include "arcpgu_regs.h"
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 04/14] drm: make drm_framebuffer.h self contained

2018-12-30 Thread Sam Ravnborg
Add forward declaration and pull in include
file to make drm_framebuffer.h self contained.

While add it order include files alphabetically.

The use of TASK_COMM_LEN is the reason for including sched.h.
I could not see any good way to avoid this dependency,
and users of drm_framebuffer.comm already use
TASK_COMM_LEN to check for length etc.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 include/drm/drm_framebuffer.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h
index c94acedfb08e..f639ed527943 100644
--- a/include/drm/drm_framebuffer.h
+++ b/include/drm/drm_framebuffer.h
@@ -23,13 +23,16 @@
 #ifndef __DRM_FRAMEBUFFER_H__
 #define __DRM_FRAMEBUFFER_H__
 
-#include 
 #include 
+#include 
+#include 
+
 #include 
 
 struct drm_framebuffer;
 struct drm_file;
 struct drm_device;
+struct drm_clip_rect;
 
 /**
  * struct drm_framebuffer_funcs - framebuffer hooks
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 05/14] drm: make drm_file.h self contained

2018-12-30 Thread Sam Ravnborg
drm_file.h embed struct idr, so this file need to know
the full type definition.

With this change users of drm_file.h are no longer forced
to include idr.h - a file they usually get from drmP.h

This makes it simpler to remove drmP.h includes

Signed-off-by: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Daniel Vetter 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
---
 include/drm/drm_file.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 84ac79219e4c..bbdb74c3d7ff 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -30,6 +30,7 @@
 #ifndef _DRM_FILE_H_
 #define _DRM_FILE_H_
 
+#include 
 #include 
 #include 
 
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 12/14] drm/stm: do not reply on drmP.h from drm_gem_cma_helper.h

2018-12-30 Thread Sam Ravnborg
drmP.h was the only header file in the past and a lot
of files rely on that drmP.h defines everything.
The goal is to one day to delete drmP.h and
as a step towards this it will no longer be included in the
headers files in include/drm/

To prepare stm/ for this add dependencies that
othwewise was pulled in by drmP.h from drm_gem_cma_helper.h

Sort the include list when we anyway modify it.

Signed-off-by: Sam Ravnborg 
Cc: Yannick Fertre 
Cc: Philippe Cornu 
Cc: Benjamin Gaignard 
Cc: Vincent Abriou 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/stm/drv.c  | 6 +-
 drivers/gpu/drm/stm/ltdc.c | 9 -
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 8dec001b9d37..9cd6228a18ad 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -9,15 +9,19 @@
  */
 
 #include 
+#include 
+#include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
+#include 
+#include 
 
 #include "ltdc.h"
 
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 61dd661aa0ac..5cce6c7f35d4 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -10,17 +10,24 @@
 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 02/14] drm: drm_device.h: update comments to kernel-doc style

2018-12-30 Thread Sam Ravnborg
Updated comment style to kernel-doc format in drm_device.h

In struct drm_device there are 12 struct members without doc:
- registered
- filelist_mutex
- filelist
- irq
- vbl_lock
- event_lock
- hose
- sigdata
- sigdata.context
- sigdata.lock
- agp_buffer_map
- agp_buffer_token

They all need proper documentation, a task left for someone
that knows their usage.

drm_device is not plugged into Documentation/gpu/drm-internals.rst
as this would create a new load of warnings.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Jonathan Corbet 
---
 include/drm/drm_device.h | 199 +++
 1 file changed, 134 insertions(+), 65 deletions(-)

diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index 42411b3ea0c8..2b154ead9efc 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -25,24 +25,48 @@ struct pci_dev;
 struct pci_controller;
 
 /**
- * DRM device structure. This structure represent a complete card that
+ * struct drm_device - DRM device structure
+ *
+ * This structure represent a complete card that
  * may contain multiple heads.
  */
 struct drm_device {
-   struct list_head legacy_dev_list;/**< list of devices per driver for 
stealth attach cleanup */
-   int if_version; /**< Highest interface version set */
-
-   /** \name Lifetime Management */
-   /*@{ */
-   struct kref ref;/**< Object ref-count */
-   struct device *dev; /**< Device structure of bus-device */
-   struct drm_driver *driver;  /**< DRM driver managing the device */
-   void *dev_private;  /**< DRM driver private data */
-   struct drm_minor *primary;  /**< Primary node */
-   struct drm_minor *render;   /**< Render node */
+   /**
+* @legacy_dev_list:
+*
+* List of devices per driver for stealth attach cleanup
+*/
+   struct list_head legacy_dev_list;
+
+   /** @if_version: Highest interface version set */
+   int if_version;
+
+   /** @ref: Object ref-count */
+   struct kref ref;
+
+   /** @dev: Device structure of bus-device */
+   struct device *dev;
+
+   /** @driver: DRM driver managing the device */
+   struct drm_driver *driver;
+
+   /** @dev_private: DRM driver private data */
+   void *dev_private;
+
+   /** @primary: Primary node */
+   struct drm_minor *primary;
+
+   /** @render: Render node */
+   struct drm_minor *render;
+
bool registered;
 
-   /* currently active master for this device. Protected by master_mutex */
+   /**
+* @master:
+*
+* Currently active master for this device.
+* Protected by _mutex
+*/
struct drm_master *master;
 
/**
@@ -63,23 +87,42 @@ struct drm_device {
 */
bool unplugged;
 
-   struct inode *anon_inode;   /**< inode for private 
address-space */
-   char *unique;   /**< unique name of the device 
*/
-   /*@} */
+   /** @anon_inode: inode for private address-space */
+   struct inode *anon_inode;
+
+   /** @unique: Unique name of the device */
+   char *unique;
+
+   /**
+* @struct_mutex:
+*
+* Lock for others (not _minor.master and _file.is_master)
+*/
+   struct mutex struct_mutex;
+
+   /**
+* @master_mutex:
+*
+* Lock for _minor.master and _file.is_master
+*/
+   struct mutex master_mutex;
+
+   /**
+* @open_count:
+*
+* Usage counter for outstanding files open,
+* protected by drm_global_mutex
+*/
+   int open_count;
+
+   /** @buf_lock: Lock for _use and a few other things. */
+   spinlock_t buf_lock;
 
-   /** \name Locks */
-   /*@{ */
-   struct mutex struct_mutex;  /**< For others */
-   struct mutex master_mutex;  /**< For drm_minor::master and 
drm_file::is_master */
-   /*@} */
+   /** @buf_use: Usage counter for buffers in use -- cannot alloc */
+   int buf_use;
 
-   /** \name Usage Counters */
-   /*@{ */
-   int open_count; /**< Outstanding files open, protected 
by drm_global_mutex. */
-   spinlock_t buf_lock;/**< For drm_device::buf_use and a few 
other things. */
-   int buf_use;/**< Buffers in use -- cannot alloc */
-   atomic_t buf_alloc; /**< Buffer allocation in progress */
-   /*@} */
+   /** @buf_alloc: Buffer allocation in progress */
+   atomic_t buf_alloc;
 
struct mutex filelist_mutex;
struct list_head filelist;
@@ -87,51 +130,64 @@ struct drm_device {
/**
 * @filelist_internal:
 *
-* List of open DRM files for in-kernel clients. Protected 

[PATCH v2 01/14] drm: move DRM_IF_VERSION to drm_internal.h

2018-12-30 Thread Sam Ravnborg
Move DRM_IF_VERSION out of drmP.h to allow users
to get rid of the drmP include.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Signed-off-by: Daniel Vetter 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20181226210353.13993-1-...@ravnborg.org
---
 drivers/gpu/drm/drm_internal.h | 2 ++
 include/drm/drmP.h | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index c7a7d7ce5d1c..331112b2ae88 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -26,6 +26,8 @@
 #define DRM_IF_MAJOR 1
 #define DRM_IF_MINOR 4
 
+#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
+
 struct drm_prime_file_private;
 struct dma_buf;
 
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index bdb0d5548f39..db94ef00940e 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -94,8 +94,6 @@ struct dma_buf_attachment;
 struct pci_dev;
 struct pci_controller;
 
-#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
-
 #define DRM_SWITCH_POWER_ON 0
 #define DRM_SWITCH_POWER_OFF 1
 #define DRM_SWITCH_POWER_CHANGING 2
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 07/14] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h

2018-12-30 Thread Sam Ravnborg
In the quest to get rid of drmP.h move the newly
added EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h.
Fix the single user.

Add a note to drmP.h to avoid further use of it.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/drm_framebuffer.c |  1 +
 include/drm/drmP.h| 11 ++-
 include/drm/drm_util.h| 10 ++
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_framebuffer.c 
b/drivers/gpu/drm/drm_framebuffer.c
index fcaea8f50513..7abcb265a108 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "drm_internal.h"
 #include "drm_crtc_internal.h"
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index bc4cb3732407..3f5c577c9dbd 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -94,10 +94,11 @@ struct dma_buf_attachment;
 struct pci_dev;
 struct pci_controller;
 
-#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
-#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
-#else
-#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
-#endif
+/*
+ * NOTE: drmP.h is obsolete - do NOT add anything to this file
+ *
+ * Do not include drmP.h in new files.
+ * Work is ongoing to remove drmP.h includes from existing files
+ */
 
 #endif
diff --git a/include/drm/drm_util.h b/include/drm/drm_util.h
index 8fda5777471c..cd1e4be1dfb3 100644
--- a/include/drm/drm_util.h
+++ b/include/drm/drm_util.h
@@ -37,6 +37,16 @@
 #include 
 #include 
 
+/*
+ * Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall
+ * only be visible for drmselftests.
+ */
+#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
+#else
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
+#endif
+
 /**
  * for_each_if - helper for handling conditionals in various for_each macros
  * @condition The condition to check
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 06/14] drm: move drm_can_sleep() to drm_util.h

2018-12-30 Thread Sam Ravnborg
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.

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

Add include of drm_util.h to all users.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: Gerd Hoffmann 
Cc: Rob Clark 
Cc: Tomi Valkeinen 
Cc: Eric Anholt 
---
 drivers/gpu/drm/amd/amdgpu/atom.c   |  2 ++
 drivers/gpu/drm/ast/ast_fb.c|  2 ++
 drivers/gpu/drm/cirrus/cirrus_fbdev.c   |  1 +
 drivers/gpu/drm/drm_flip_work.c |  1 +
 drivers/gpu/drm/mgag200/mgag200_fb.c|  1 +
 drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c|  1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c|  1 +
 drivers/gpu/drm/qxl/qxl_cmd.c   |  2 ++
 drivers/gpu/drm/radeon/atom.c   |  2 ++
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c |  1 +
 drivers/gpu/drm/vc4/vc4_drv.h   |  1 +
 include/drm/drmP.h  |  8 -
 include/drm/drm_util.h  | 42 -
 13 files changed, 56 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c 
b/drivers/gpu/drm/amd/amdgpu/atom.c
index e9934de1b9cf..dd30f4e61a8c 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -27,6 +27,8 @@
 #include 
 #include 
 
+#include 
+
 #define ATOM_DEBUG
 
 #include "atom.h"
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index a80bca1a857f..eb66bf7d3e63 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -39,7 +39,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+
 #include "ast_drv.h"
 
 static void ast_dirty_update(struct ast_fbdev *afbdev,
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c 
b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index 4dd499c7d1ba..79fea1b8bc14 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -10,6 +10,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c
index 12dea16f22a8..3da3bf5af405 100644
--- a/drivers/gpu/drm/drm_flip_work.c
+++ b/drivers/gpu/drm/drm_flip_work.c
@@ -22,6 +22,7 @@
  */
 
 #include 
+#include 
 #include 
 
 /**
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c 
b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 30726c9fe28c..6893934b26c0 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -12,6 +12,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c 
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
index 96c2b828dba4..fa2d1d8995ee 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
@@ -16,6 +16,7 @@
  * this program.  If not, see .
  */
 
+#include 
 
 #include "mdp5_kms.h"
 #include "mdp5_smp.h"
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c 
b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index aee99194499f..851c59f07eb1 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -16,6 +16,7 @@
  */
 
 #include 
+#include 
 #include 
 
 #include "omap_drv.h"
diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c
index dffc5093ff16..2e100f644236 100644
--- a/drivers/gpu/drm/qxl/qxl_cmd.c
+++ b/drivers/gpu/drm/qxl/qxl_cmd.c
@@ -25,6 +25,8 @@
 
 /* QXL cmd/ring handling */
 
+#include 
+
 #include "qxl_drv.h"
 #include "qxl_object.h"
 
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index e55cbeee7a53..ac98ad561870 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -27,6 +27,8 @@
 #include 
 #include 
 
+#include 
+
 #define ATOM_DEBUG
 
 #include "atom.h"
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 222a1fa41d7c..7e3257e8fd56 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -24,6 +24,7 @@
  *  Alex Deucher
  */
 #include 
+#include 
 #include 
 #include 
 #include "radeon.h"
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index c24b078f0593..2c635f001c71 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 9e47c8dc6b87..bc4cb3732407 100644
--- a/include/drm/drmP.h
+++ 

[PATCH v2 03/14] drm: move DRM_SWITCH_POWER defines to drm_device.h

2018-12-30 Thread Sam Ravnborg
Move DRM_SWITCH_POWER out of drmP.h to allow users
to get rid of the drmP include.
Moved to drm_device.h because drm_device.switch_power_state
is the only user.

Converted to enum and added sparse kerneldoc comments.

Signed-off-by: Sam Ravnborg 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 include/drm/drmP.h   |  5 -
 include/drm/drm_device.h | 29 -
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index db94ef00940e..9e47c8dc6b87 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -94,11 +94,6 @@ struct dma_buf_attachment;
 struct pci_dev;
 struct pci_controller;
 
-#define DRM_SWITCH_POWER_ON 0
-#define DRM_SWITCH_POWER_OFF 1
-#define DRM_SWITCH_POWER_CHANGING 2
-#define DRM_SWITCH_POWER_DYNAMIC_OFF 3
-
 /* returns true if currently okay to sleep */
 static inline bool drm_can_sleep(void)
 {
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index 2b154ead9efc..d7cedbac66a3 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -24,6 +24,25 @@ struct inode;
 struct pci_dev;
 struct pci_controller;
 
+
+/**
+ * enum drm_switch_power - power state of drm device
+ */
+
+enum switch_power_state {
+   /** @DRM_SWITCH_POWER_ON: Power state is ON */
+   DRM_SWITCH_POWER_ON = 0,
+
+   /** @DRM_SWITCH_POWER_OFF: Power state is OFF */
+   DRM_SWITCH_POWER_OFF = 1,
+
+   /** @DRM_SWITCH_POWER_CHANGING: Power state is changing */
+   DRM_SWITCH_POWER_CHANGING = 2,
+
+   /** @DRM_SWITCH_POWER_DYNAMIC_OFF: Suspended */
+   DRM_SWITCH_POWER_DYNAMIC_OFF = 3,
+};
+
 /**
  * struct drm_device - DRM device structure
  *
@@ -291,7 +310,15 @@ struct drm_device {
/** @vma_offset_manager: GEM information */
struct drm_vma_offset_manager *vma_offset_manager;
 
-   int switch_power_state;
+   /**
+* @switch_power_state:
+*
+* Power state of the client.
+* Used by drivers supporting the switcheroo driver.
+* The state is maintained in the
+* _switcheroo_client_ops.set_gpu_state callback
+*/
+   enum switch_power_state switch_power_state;
 
/**
 * @fb_helper:
-- 
2.12.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 3/7] drm: rockchip: vop: add rk3066 vop definitions

2018-12-30 Thread Heiko Stuebner
Hi Johan,

Am Samstag, 29. Dezember 2018, 14:33:14 CET schrieb Johan Jonker:
> From: Mark Yao 
> 
> This patch adds the rk3066 VOP definitions.
> 
> The VOP or LCD Controller serves as interface between
> framebuffer memory and a display device (LCD panel or TV set).
> 
> This SOC has two symmetrical LCDC's for a dual panel application.
> 
> A LCDC has 5 display layers.
> Only 3 are used here.
> 
> - Video layer 0 (Win0)
> - Video layer 1 (Win1)
> - OSD layer (Win2)

Patch itself looks good, we'll need to wait a bit to give Rob a chance
to look at the (simple) dt-binding change and I'll drop the paragraph
about the display layers when applying.

Looking at the rk3066-manual, the lcdcs really only have 3 fully usable
layers + the special cursor layer which is right now not really usable in
a drm context, so the above paragraph is misleading, so I'll just drop it.

Heiko


> Win0 and Win1 are exchangeable.
> Maximum resolution is 1920x1080.
> 
> The LCDC0 output is connected to:
> - LCDC0 IO (without IOMUX)
> - HDMI TX video input
> 
> The LCDC1 output is connected to:
> - LCDC1 IO (with IOMUX)
> - HDMI TX video input
> 
> The HDMI TX input can switch between LCDC0 and LCDC1.
> 
> Signed-off-by: Mark Yao 
> Signed-off-by: Johan Jonker 



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 2/7] clk: rockchip: rk3188: add CLK_SET_RATE_PARENT for lcdc dclk

2018-12-30 Thread Heiko Stuebner
Am Samstag, 29. Dezember 2018, 14:33:13 CET schrieb Johan Jonker:
> From: Finley Xiao 
> 
> Add CLK_SET_RATE_PARENT for lcdc dclk.
> 
> Signed-off-by: Finley Xiao 
> Signed-off-by: Johan Jonker 

applied for 4.22

Thanks
Heiko


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 7/8] drm/msm/dsi: reduce indentation

2018-12-30 Thread Julia Lawall
Delete tab aligning a statement with the right hand side of a
preceding assignment rather than the left hand side.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c 
b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index 1760483b247e..4d8785282c6c 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -355,7 +355,7 @@ int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing 
*timing,
} else {
timing->shared_timings.clk_pre =
linear_inter(tmax, tmin, pcnt2, 0, false);
-   timing->shared_timings.clk_pre_inc_by_2 = 0;
+   timing->shared_timings.clk_pre_inc_by_2 = 0;
}
 
timing->ta_go = 3;

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 0/8] reduce indentation

2018-12-30 Thread Julia Lawall
These patches fix cases where a subsequent statement is aligned
with the right hand side of an assignment rather than the left
hand side.  This was done using the following semantic match
(http://coccinelle.lip6.fr/).  It has a lot of false positives,
because Coccinelle doesn't record the difference between a space
and a tab, but these issues are easy to skip over.

// 
@r@
expression x,e;
statement S;
position p0,p1,p2;
@@
x@p0 = e@p1;
S@p2

@script:ocaml@
p0 << r.p0;
p1 << r.p1;
p2 << r.p2;
@@
if ((List.hd p0).col < (List.hd p1).col &&
(List.hd p1).col = (List.hd p2).col)
then Coccilib.print_main "" p1
// 

---

 drivers/firmware/stratix10-svc.c  |   12 ++--
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c |2 +-
 drivers/iommu/msm_iommu.c |8 
 drivers/net/ethernet/amazon/ena/ena_eth_com.c |4 ++--
 drivers/net/ethernet/intel/i40e/i40e_main.c   |2 +-
 drivers/scsi/pm8001/pm8001_sas.c  |2 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c|6 +++---
 drivers/usb/gadget/udc/snps_udc_core.c|   17 -
 8 files changed, 26 insertions(+), 27 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 02/10] drm/etnaviv: mmuv2: don't map zero page

2018-12-30 Thread Guido Günther
Hi Lucas,
On Wed, Dec 19, 2018 at 03:45:38PM +0100, Lucas Stach wrote:
> Keep the page at address 0 as faulting to catch any potential state
> setup issues early.

This is a nice idea! But applying this and making mesa hit that page
leads to the process hanging in D state over here on GC7000:

# [  242.726192] INFO: task kworker/u8:2:37 blocked for more than 120 seconds.
[  242.733010]   Not tainted 4.18.0-00129-gce2b21074b41 #504
[  242.738795] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this 
message.
[  242.746638] kworker/u8:2D037  2 0x0028
[  242.752144] Workqueue: events_unbound commit_work
[  242.756860] Call trace:
[  242.759318]  __switch_to+0x94/0xd0
[  242.762741]  __schedule+0x1c0/0x6b8
[  242.766239]  schedule+0x40/0xa8
[  242.769380]  schedule_timeout+0x2f0/0x428
[  242.773410]  dma_fence_default_wait+0x1cc/0x2b8
[  242.777951]  dma_fence_wait_timeout+0x44/0x1b0
[  242.782403]  drm_atomic_helper_wait_for_fences+0x48/0x108
[  242.787819]  commit_tail+0x30/0x80
[  242.791229]  commit_work+0x20/0x30
[  242.794642]  process_one_work+0x1ec/0x458
[  242.798659]  worker_thread+0x48/0x430
[  242.802331]  kthread+0x130/0x138
[  242.805557]  ret_from_fork+0x10/0x1c

This is in dmesg showing that we hit the first page:

[   65.907388] etnaviv-gpu 3800.gpu: MMU fault status 0x0002
[   65.913497] etnaviv-gpu 3800.gpu: MMU 0 fault addr 0x0e40

Without that patch it's sampling random data from that page but does not hang.

Cheers,
 -- Guido

> 
> Signed-off-by: Lucas Stach 
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c 
> b/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c
> index f1c88d8ad5ba..f794e04be9e6 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c
> @@ -320,8 +320,8 @@ etnaviv_iommuv2_domain_alloc(struct etnaviv_gpu *gpu)
>   domain = _domain->base;
>  
>   domain->dev = gpu->dev;
> - domain->base = 0;
> - domain->size = (u64)SZ_1G * 4;
> + domain->base = SZ_4K;
> + domain->size = (u64)SZ_1G * 4 - SZ_4K;
>   domain->ops = _iommuv2_ops;
>  
>   ret = etnaviv_iommuv2_init(etnaviv_domain);
> -- 
> 2.19.1
> 
> ___
> etnaviv mailing list
> etna...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 109182] [AMD][TAHITI XT] CSGO rendering artifact on dashboard human body

2018-12-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=109182

Bug ID: 109182
   Summary: [AMD][TAHITI XT] CSGO rendering artifact on dashboard
human body
   Product: Mesa
   Version: git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/Gallium/radeonsi
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: sylvain.bertr...@gmail.com
QA Contact: dri-devel@lists.freedesktop.org

Everything git, less than a week (llvm/mesa/drm/xserver/xf86-video-amdgpu)
linux amd-staging-drm-next).
Whatever the csgo 3D engine settings, in the dashboard, the human body shown
there demonstrates rendering artifacts.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 1/7] ARM: dts: rockchip: rk3066: add HCLK_HDMI to pmu node

2018-12-30 Thread Heiko Stuebner
Am Samstag, 29. Dezember 2018, 14:33:12 CET schrieb Johan Jonker:
> A MK808 TV stick with rk3066 processor
> boots normal with logo and console,
> but after booting the monitor remains black.
> This patch fixes a vblank wait time out
> by adding HCLK_HDMI to the pmu node.
> The HCLK_HDMI clock is now part of the logic
> that enables the RK3066_PD_VIO power domain.
> 
> Signed-off-by: Johan Jonker 

applied for 4.22

Thanks
Heiko


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: Reorder set_property_atomic to avoid returning with an active ww_ctx

2018-12-30 Thread Chris Wilson
Delay the drm_modeset_acquire_init() until after we check for an
allocation failure so that we can return immediately upon error without
having to unwind.

WARNING: lock held when returning to user space!
4.20.0+ #174 Not tainted

syz-executor556/8153 is leaving the kernel with locks still held!
1 lock held by syz-executor556/8153:
  #0: 5100c85c (crtc_ww_class_acquire){+.+.}, at:
set_property_atomic+0xb3/0x330 drivers/gpu/drm/drm_mode_object.c:462

Reported-by: syzbot+6ea337c427f5083eb...@syzkaller.appspotmail.com
Fixes: 144a7999d633 ("drm: Handle properties in the core for atomic drivers")
Signed-off-by: Chris Wilson 
Cc: Daniel Vetter 
Cc: Maarten Lankhorst 
Cc: Sean Paul 
Cc: David Airlie 
Cc:  # v4.14+
---
 drivers/gpu/drm/drm_mode_object.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_mode_object.c 
b/drivers/gpu/drm/drm_mode_object.c
index bb1dd46496cd..a9005c1c2384 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -459,12 +459,13 @@ static int set_property_atomic(struct drm_mode_object 
*obj,
struct drm_modeset_acquire_ctx ctx;
int ret;
 
-   drm_modeset_acquire_init(, 0);
-
state = drm_atomic_state_alloc(dev);
if (!state)
return -ENOMEM;
+
+   drm_modeset_acquire_init(, 0);
state->acquire_ctx = 
+
 retry:
if (prop == state->dev->mode_config.dpms_property) {
if (obj->type != DRM_MODE_OBJECT_CONNECTOR) {
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 109080] Broken video playback colors on AMD Ryzen 5 (PRO) Mobile 2500U in 18.1 and 18.2

2018-12-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=109080

--- Comment #1 from Rafał Miłecki  ---
The announcement on Mesa 3D webpage says:

> NOTE: It is anticipated that 18.2.8 will be the final release in the 18.2 
> series. Users of 18.2 are encouraged to migrate to the 18.3 series in order 
> to obtain future fixes.

So I guess nobody will care about cherry-picking those fixes? Should this just
get closed? Boyuan could you comment on this?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 109181] Mesa git causes AMDGPU hang, Tonga Firepro chip W7170M MXM

2018-12-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=109181

Bug ID: 109181
   Summary: Mesa git causes AMDGPU hang, Tonga Firepro chip W7170M
MXM
   Product: Mesa
   Version: git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/Gallium/radeonsi
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: babblebo...@gmail.com
QA Contact: dri-devel@lists.freedesktop.org

Hello,

I've run into a bug wherein AMDGPU hangs as mesa 19 does something it doesn't
like in particular applications. Mesa 18.3 is totally fine, as per padoka
stable ppa. Padoka unstable and Oibaf both crash.
OpenGL like team fortress 2 seem to be fine but Vulkan (DXVK) wrapped
applications  will just bury the whole GPU.
Even steam itself seems to hard lock when I start it which I can sidesetep by
allowing GPU recovery with the kernel parameter and proceed. It does not
recover when I start something vulkan and graphically intensive from steam
itself.



Below is my dmesg from the card. This may be an issue with mesa or it may be
AMDGPU, I am very curious as to which as this has affected me for about a month
now across both Arch Linux and my new Ubuntu install, making mesa git unusable
on my new card.

To make matters worse there is an issue wherein the EDID is messed up on boot
with amdgpu.dc=1, worth mentioning if it's part of a deeper issue in AMDGPU.




[   55.671991] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout,
signaled seq=1614, emitted seq=1616
[   55.671996] amdgpu :01:00.0: GPU reset begin!
[   55.678313] amdgpu :01:00.0: GPU pci config reset
[   55.682867] amdgpu :01:00.0: GPU reset succeeded, trying to resume
[   55.683678] [drm] PCIE GART of 1024M enabled (table at 0x00F4007E9000).
[   55.687097] amdgpu: [powerplay] dpm has been enabled
[   55.741072] [drm] UVD initialized successfully.
[   55.950146] [drm] VCE initialized successfully.
[   55.952966] [drm] recover vram bo from shadow start
[   55.955698] [drm] recover vram bo from shadow done
[   55.955746] WARNING: CPU: 5 PID: 120 at
/build/linux-liquorix-eJ9K8E/linux-liquorix-4.19/include/linux/dma-fence.h:503
drm_sched_job_recovery+0x1db/0x1e0 [gpu_sched]
[   55.955747] Modules linked in: rfcomm fuse ccm ext4 jbd2 fscrypto af_packet
cmac bnep uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2
videobuf2_common btusb btrtl btbcm btintel videodev bluetooth media
ecdh_generic crc16 nls_utf8 nls_cp437 vfat fat ext2 mbcache squashfs loop
snd_hda_codec_idt snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_intel
snd_hda_codec snd_hda_core arc4 snd_hwdep intel_rapl snd_pcm
x86_pkg_temp_thermal intel_powerclamp snd_seq_dummy coretemp snd_seq_oss
snd_seq_midi kvm_intel snd_seq_midi_event ath9k ath9k_common snd_rawmidi
ath9k_hw kvm snd_seq ath irqbypass crct10dif_pclmul crc32_pclmul
ghash_clmulni_intel snd_seq_device mac80211 snd_timer pcbc aesni_intel
aes_x86_64 crypto_simd cryptd glue_helper joydev input_leds snd cfg80211
tpm_infineon hp_wmi sparse_keymap
[   55.955775]  serio_raw wmi_bmof sg lpc_ich rfkill soundcore tpm_tis
tpm_tis_core tpm rng_core hp_accel lis3lv02d input_polldev evdev pcc_cpufreq
acpi_cpufreq battery ac hp_wireless sch_fq_codel parport_pc ppdev lp parport
ip_tables x_tables ipv6 crc_ccitt autofs4 btrfs xor raid6_pq libcrc32c
crc32c_generic bcache crc64 sr_mod cdrom sd_mod hid_generic usbhid amdkfd
amd_iommu_v2 amdgpu chash gpu_sched ahci i2c_algo_bit libahci ttm sdhci_pci
libata cqhci drm_kms_helper sdhci ehci_pci crc32c_intel firewire_ohci xhci_pci
drm psmouse i2c_i801 firewire_core scsi_mod mmc_core crc_itu_t e1000e ehci_hcd
i2c_core xhci_hcd thermal wmi rtc_cmos video button
[   55.955806] CPU: 5 PID: 120 Comm: kworker/5:1 Not tainted
4.19.0-13.1-liquorix-amd64 #1 liquorix 4.19-8ubuntu1~bionic
[   55.955807] Hardware name: Hewlett-Packard /176C, BIOS 68IAV Ver. F.70
07/30/2018
[   55.955809] Workqueue: events drm_sched_job_timedout [gpu_sched]
[   55.955811] RIP: 0010:drm_sched_job_recovery+0x1db/0x1e0 [gpu_sched]
[   55.955812] Code: ff ff ff 48 8b 3c 24 48 83 c4 20 5b 5d 41 5c 41 5d 41 5e
41 5f e9 d5 ab 71 e1 4c 89 f6 4c 89 ff e8 5a fd ff ff e9 33 ff ff ff <0f> 0b eb
93 90 55 53 48 89 fb 48 8b 46 10 48 89 f7 48 8b 68 08 48
[   55.955813] RSP: 0018:c900038e7de0 EFLAGS: 00210202
[   55.955814] RAX: 0523 RBX: 11704df0 RCX:
0001
[   55.955814] RDX: 88878c5d8050 RSI: 888107c18c00 RDI:
00200286
[   55.955815] RBP: 11704d10 R08:  R09:
0001
[   55.955816] R10: c90003213dd0 R11: 0026 R12:
1491cb00
[   55.955816] R13: 11704e28 R14: 88878c5d8000 R15:
11704c98
[   55.955817] FS:  () GS:1db4()
knlGS:
[   55.955818] CS:  0010 DS:  ES:  CR0: 

Re: [Nouveau] [PATCH] drm/nouveau: Don't disable polling in fallback mode

2018-12-30 Thread Ilia Mirkin
Ben - ping? Just ran into this myself on a NV42.

On Wed, Nov 14, 2018 at 11:01 AM Takashi Iwai  wrote:
>
> On Fri, 14 Sep 2018 13:59:25 +0200,
> Martin Peres wrote:
> >
> > On 14/09/2018 10:28, Ben Skeggs wrote:
> > > On Wed, 12 Sep 2018 at 20:59, Takashi Iwai  wrote:
> > >>
> > >> When a fan is controlled via linear fallback without cstate, we
> > >> shouldn't stop polling.  Otherwise it won't be adjusted again and
> > >> keeps running at an initial crazy pace.
> > > Martin,
> > >
> > > Any thoughts on this?
> > >
> > > Ben.
> >
> > Wow, blast from the past!
> >
> > Anyway, the analysis is pretty spot on here. When using the cstate-based
> > fan speed (change the speed of the fan based on what frequency is used),
> > then polling is unnecessary and this function should only be called when
> > changing the pstate.
> >
> > However, in the absence of ANY information, we fallback to a
> > temperature-based management which requires constant polling, so the
> > patch is accurate and poll = false should only be set if we have a cstate.
> >
> > So, the patch is Reviewed-by: Martin Peres 
>
> Just a gentle reminder: this patch seems forgotten for 4.20 merge.
> Could you guys pick it if it's OK?
>
>
> Thanks!
>
> Takashi
>
> >
> > >
> > >>
> > >> Fixes: 800efb4c2857 ("drm/nouveau/drm/therm/fan: add a fallback if no 
> > >> fan control is specified in the vbios")
> > >> Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1103356
> > >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107447
> >
> > I see that Thomas has been having issues with the noise level anyway. I
> > suggest he should bump the value of temp1_auto_point1_temp (see
> > https://www.kernel.org/doc/Documentation/thermal/nouveau_thermal).
> >
> > The default value is set to 90°C which is quite safe on these old GPUs
> > (NVIDIA G71 / nv49). I would say that it is safe to go up to 110°C.
> > Which should reduce the noise level.
> >
> > Another technique may be to reduce the minimum fan speed to something
> > lower than 30°C. It should increase the slope but reduce the noise level
> > at a given temperature.
> >
> > One reason why these GPUs run so hot on nouveau is the lack of power and
> > clock gating. I am sorry that I never finished to reverse engineer these...
> >
> > Anyway, thanks a lot for the patch!
> >
> > >> Reported-by: Thomas Blume 
> > >> Signed-off-by: Takashi Iwai 
> > >>
> > >> ---
> > >>  drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 7 ---
> > >>  1 file changed, 4 insertions(+), 3 deletions(-)
> > >>
> > >> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c 
> > >> b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
> > >> index 3695cde669f8..07914e36939e 100644
> > >> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
> > >> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
> > >> @@ -132,11 +132,12 @@ nvkm_therm_update(struct nvkm_therm *therm, int 
> > >> mode)
> > >> duty = nvkm_therm_update_linear(therm);
> > >> break;
> > >> case NVBIOS_THERM_FAN_OTHER:
> > >> -   if (therm->cstate)
> > >> +   if (therm->cstate) {
> > >> duty = therm->cstate;
> > >> -   else
> > >> +   poll = false;
> > >> +   } else {
> > >> duty = 
> > >> nvkm_therm_update_linear_fallback(therm);
> > >> -   poll = false;
> > >> +   }
> > >> break;
> > >> }
> > >> immd = false;
> > >> --
> > >> 2.18.0
> > >>
> > >> ___
> > >> Nouveau mailing list
> > >> nouv...@lists.freedesktop.org
> > >> https://lists.freedesktop.org/mailman/listinfo/nouveau
> >
> ___
> Nouveau mailing list
> nouv...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel