[PATCH] drm/ttm: fix kref count mess in ttm_bo_move_to_lru_tail

2016-04-27 Thread Thomas Hellstrom
LGTM Reviewed-by: Thomas Hellstrom On 04/26/2016 06:50 AM, Alex Deucher wrote: > Ping. Any objections? > > > On Wed, Apr 20, 2016 at 1:52 PM, Alex Deucher > wrote: >> From: Flora Cui >> >> Fixes the following scenario: >> >> 1. Page tabl

[PATCH 09/20] drm/kms: Nuke dirty_info property

2016-08-09 Thread Thomas Hellstrom
0aa3ce3214259e69557be5b4ce0d781ffa4 > Author: Jakob Bornecrantz > Date: Thu Dec 3 23:25:47 2009 + > > drm: Add dirty ioctl and property > > Cc: Jakob Bornecrantz > Cc: Dave Airlie > Cc: Sinclair Yeh > Cc: Thomas Hellstrom > Signed-off-by: Daniel Vetter >

[PATCH 09/20] drm/kms: Nuke dirty_info property

2016-08-10 Thread Thomas Hellstrom
On 08/09/2016 04:08 PM, Daniel Vetter wrote: > On Tue, Aug 9, 2016 at 3:59 PM, Thomas Hellstrom > wrote: >> Hmm. >> >> I don't have a strong opinion on this, but IMO the original idea of >> allowing a user-space driver to optimize away the dirty calls isn'

Fwd: [PATCH] kref: prefer atomic_inc_not_zero to atomic_add_unless

2016-08-10 Thread Thomas Hellstrom
By request forwarded patch This is also Reviewed-by: Thomas Hellstrom /Thomas Forwarded Message Subject:[PATCH] kref: prefer atomic_inc_not_zero to atomic_add_unless Date: Sat, 10 Oct 2015 12:56:34 +0200 From: Jason A. Donenfeld To: Dave Airlie , Thomas

Re: [PATCH 1/2] drm/ttm: fix busy memory to fail other user v6

2019-05-07 Thread Thomas Hellstrom
On 5/7/19 1:24 PM, Christian König wrote: Am 07.05.19 um 13:22 schrieb zhoucm1: On 2019年05月07日 19:13, Koenig, Christian wrote: Am 07.05.19 um 13:08 schrieb zhoucm1: On 2019年05月07日 18:53, Koenig, Christian wrote: Am 07.05.19 um 11:36 schrieb Chunming Zhou: heavy gpu job could occupy memory

Re: [PATCH 1/2] drm/ttm: fix busy memory to fail other user v6

2019-05-08 Thread Thomas Hellstrom
On 5/7/19 1:42 PM, Koenig, Christian wrote: Am 07.05.19 um 13:37 schrieb Thomas Hellstrom: [CAUTION: External Email] On 5/7/19 1:24 PM, Christian König wrote: Am 07.05.19 um 13:22 schrieb zhoucm1: On 2019年05月07日 19:13, Koenig, Christian wrote: Am 07.05.19 um 13:08 schrieb zhoucm1: On 2019

Re: [PATCH] drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()

2019-05-13 Thread Thomas Hellstrom
On Sat, 2019-05-11 at 18:01 +1200, Murray McAllister wrote: > If SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW is called with a surface > ID of SVGA3D_INVALID_ID, the srf struct will remain NULL after > vmw_cmd_res_check(), leading to a null pointer dereference in > vmw_view_add(). > > Signed-off-by: Mu

[PATCH] drm/ttm, drm/vmwgfx: Use a configuration option for the TTM dma page pool

2019-05-16 Thread Thomas Hellstrom
Drivers like vmwgfx may want to test whether the dma page pool is present or not. Since it's activated by default by TTM if compiled-in, define a hidden configuration option that the driver can test for. Cc: Christian König Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/Kc

Re: [PATCH] drm/ttm, drm/vmwgfx: Use a configuration option for the TTM dma page pool

2019-05-16 Thread Thomas Hellstrom
On Thu, 2019-05-16 at 12:05 +0200, Christian König wrote: > Am 16.05.19 um 11:23 schrieb Thomas Hellstrom: > > Drivers like vmwgfx may want to test whether the dma page pool is > > present > > or not. Since it's activated by default by TTM if compiled-in, > > d

[PATCH v2] drm/ttm, drm/vmwgfx: Use a configuration option for the TTM dma page pool

2019-05-16 Thread Thomas Hellstrom
Drivers like vmwgfx may want to test whether the dma page pool is present or not. Since it's activated by default by TTM if compiled-in, define a hidden configuration option that the driver can test for. Cc: Christian König Signed-off-by: Thomas Hellstrom Reviewed-by: Christian

Re: [PATCH] drm/vmwgfx: integer underflow in vmw_cmd_dx_set_shader() leading to an invalid read

2019-05-20 Thread Thomas Hellstrom
Thanks, Murray, I'll include in the next vmwgfx-fixes pull request. On Mon, 2019-05-20 at 21:57 +1200, Murray McAllister wrote: > If SVGA_3D_CMD_DX_SET_SHADER is called with a shader ID > of SVGA3D_INVALID_ID, and a shader type of > SVGA3D_SHADERTYPE_INVALID, the calculated binding.shader_slot >

[PATCH 1/6] drm/vmwgfx: Don't send drm sysfs hotplug events on initial master set

2019-05-21 Thread Thomas Hellstrom
This may confuse user-space clients like plymouth that opens a drm file descriptor as a result of a hotplug event and then generates a new event... Cc: Fixes: 5ea1734827bb ("drm/vmwgfx: Send a hotplug event at master_set") Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat --

[PATCH 2/6] drm/vmwgfx: Fix user space handle equal to zero

2019-05-21 Thread Thomas Hellstrom
s idr-generated") Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat --- drivers/gpu/drm/vmwgfx/ttm_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/ttm_object.c b/drivers/gpu/drm/vmwgfx/ttm_object.c index 36990b80e790..16077785ad47 10

[PATCH 3/6] drm/vmwgfx: Fix compat mode shader operation

2019-05-21 Thread Thomas Hellstrom
ned-off-by: Thomas Hellstrom Reviewed-by: Brian Paul --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 2ff7ba04d8c8..315f9efce765 100644 --- a/drive

[PATCH 6/6] drm/vmwgfx: integer underflow in vmw_cmd_dx_set_shader() leading to an invalid read

2019-05-21 Thread Thomas Hellstrom
: Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support") Signed-off-by: Murray McAllister Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/

[PATCH 5/6] drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()

2019-05-21 Thread Thomas Hellstrom
pport") Signed-off-by: Murray McAllister Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 31

[PATCH 4/6] drm/vmwgfx: Use the dma scatter-gather iterator to get dma addresses

2019-05-21 Thread Thomas Hellstrom
or") Signed-off-by: Thomas Hellstrom Reviewed-by: Jason Gunthorpe --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 27 ++ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.

Re: [PATCH 3/5] drm/vmwgfx: use core drm to extend/check vmw_execbuf_ioctl

2019-05-22 Thread Thomas Hellstrom
bably be fixed before pushing this. > > Cc: "VMware Graphics" > Cc: Thomas Hellstrom > Cc: Daniel Vetter > Signed-off-by: Emil Velikov > --- > Thomas, VMware team, > > Please give this some testing on your end. I've only tested it > against > mes

Re: [PATCH 4/5] drm/vmwgfx: remove custom ioctl io encoding check

2019-05-22 Thread Thomas Hellstrom
Hi, Emil, On Wed, 2019-05-22 at 17:41 +0100, Emil Velikov wrote: > From: Emil Velikov > > Drop the custom ioctl io encoding check - core drm does it for us. I fail to see where the core does this, or do I miss something? Thanks, Thomas > > Cc: "VMware Graphics" >

Re: [PATCH 1/5] vmwgfx: drop empty lastclose stub

2019-05-22 Thread Thomas Hellstrom
On Wed, 2019-05-22 at 17:41 +0100, Emil Velikov wrote: > From: Emil Velikov > > Core DRM is safe when the callback is NULL. > > Cc: "VMware Graphics" > Cc: Thomas Hellstrom > Cc: Daniel Vetter > Signed-off-by: Emil Velikov Reviewed-by: Thomas Hellstrom

Re: [PATCH 2/5] drm/vmgfx: kill off unused init_mutex

2019-05-22 Thread Thomas Hellstrom
On Wed, 2019-05-22 at 17:41 +0100, Emil Velikov wrote: > From: Emil Velikov > > According to the docs - prevents firstopen/lastclose races. Yet never > used in practise. > > Cc: "VMware Graphics" > Cc: Thomas Hellstrom > Cc: Daniel Vetter > Signed-off-b

Re: [PATCH 3/5] drm/vmwgfx: use core drm to extend/check vmw_execbuf_ioctl

2019-05-23 Thread Thomas Hellstrom
ity. > > Cc: "VMware Graphics" > Cc: Thomas Hellstrom > Cc: Daniel Vetter > Signed-off-by: Emil Velikov Tested using piglit quick using execbuf versions 1 and 2. Tested-by: Thomas Hellstrom Reviewed-by: Thomas Hellstrom > --- > Thomas, VMware team, > > P

Re: [PATCH 3/5] drm/vmwgfx: use core drm to extend/check vmw_execbuf_ioctl

2019-05-23 Thread Thomas Hellstrom
On Wed, 2019-05-22 at 21:09 +0200, Daniel Vetter wrote: > On Wed, May 22, 2019 at 9:01 PM Thomas Hellstrom < > thellst...@vmware.com> wrote: > > Hi, Emil, > > > > On Wed, 2019-05-22 at 17:41 +0100, Emil Velikov wrote: > > > From: Emil Velikov > > >

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-24 Thread Thomas Hellstrom
Hi, Christian, On 5/24/19 10:37 AM, Koenig, Christian wrote: Am 24.05.19 um 10:11 schrieb Thomas Hellström (VMware): [CAUTION: External Email] From: Thomas Hellstrom With SEV encryption, all DMA memory must be marked decrypted (AKA "shared") for devices to be able to read it. In

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-24 Thread Thomas Hellstrom
On 5/24/19 11:11 AM, Thomas Hellstrom wrote: Hi, Christian, On 5/24/19 10:37 AM, Koenig, Christian wrote: Am 24.05.19 um 10:11 schrieb Thomas Hellström (VMware): [CAUTION: External Email] From: Thomas Hellstrom With SEV encryption, all DMA memory must be marked decrypted (AKA "shared&

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-24 Thread Thomas Hellstrom
On 5/24/19 12:18 PM, Koenig, Christian wrote: Am 24.05.19 um 11:55 schrieb Thomas Hellstrom: [CAUTION: External Email] On 5/24/19 11:11 AM, Thomas Hellstrom wrote: Hi, Christian, On 5/24/19 10:37 AM, Koenig, Christian wrote: Am 24.05.19 um 10:11 schrieb Thomas Hellström (VMware): [CAUTION

Re: [PATCH 3/5] drm/vmwgfx: use core drm to extend/check vmw_execbuf_ioctl

2019-05-24 Thread Thomas Hellstrom
On 5/24/19 12:53 PM, Emil Velikov wrote: On 2019/05/24, Daniel Vetter wrote: On Fri, May 24, 2019 at 8:05 AM Thomas Hellstrom wrote: On Wed, 2019-05-22 at 21:09 +0200, Daniel Vetter wrote: On Wed, May 22, 2019 at 9:01 PM Thomas Hellstrom < thellst...@vmware.com> wrote: Hi, Emil,

Re: [PATCH] drm/vmwgfx: fix a warning due to missing dma_parms

2019-05-24 Thread Thomas Hellstrom
On Fri, 2019-05-24 at 08:19 +0200, Christoph Hellwig wrote: > On Thu, May 23, 2019 at 10:37:19PM -0400, Qian Cai wrote: > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > > b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > > index bf6c3500d363..5c567b81174f 100644 > > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-24 Thread Thomas Hellstrom
On 5/24/19 2:03 PM, Koenig, Christian wrote: Am 24.05.19 um 12:37 schrieb Thomas Hellstrom: [CAUTION: External Email] On 5/24/19 12:18 PM, Koenig, Christian wrote: Am 24.05.19 um 11:55 schrieb Thomas Hellstrom: [CAUTION: External Email] On 5/24/19 11:11 AM, Thomas Hellstrom wrote: Hi

Re: [PATCH 4/5] drm/vmwgfx: remove custom ioctl io encoding check

2019-05-24 Thread Thomas Hellstrom
On Fri, 2019-05-24 at 13:14 +0100, Emil Velikov wrote: > On 2019/05/23, Thomas Hellstrom wrote: > > Hi, Emil, > > > > On Wed, 2019-05-22 at 17:41 +0100, Emil Velikov wrote: > > > From: Emil Velikov > > > > > > Drop the custom ioctl io encoding c

Re: [PATCH 4/5] drm/vmwgfx: remove custom ioctl io encoding check

2019-05-24 Thread Thomas Hellstrom
Hi, Emil On Fri, 2019-05-24 at 16:26 +0100, Emil Velikov wrote: > On 2019/05/24, Thomas Hellstrom wrote: > > On Fri, 2019-05-24 at 13:14 +0100, Emil Velikov wrote: > > > On 2019/05/23, Thomas Hellstrom wrote: > > > > Hi, Emil, > > > > > > > >

Re: [PATCH 4/5] drm/vmwgfx: remove custom ioctl io encoding check

2019-05-25 Thread Thomas Hellstrom
On Sat, 2019-05-25 at 00:39 +0200, Thomas Hellström wrote: > Hi, Emil > > On Fri, 2019-05-24 at 16:26 +0100, Emil Velikov wrote: > > On 2019/05/24, Thomas Hellstrom wrote: > > > On Fri, 2019-05-24 at 13:14 +0100, Emil Velikov wrote: > > > > On 2019/05/23,

Re: [PATCH 4/5] drm/vmwgfx: remove custom ioctl io encoding check

2019-05-27 Thread Thomas Hellstrom
Hi, Emil, On Mon, 2019-05-27 at 10:08 +0100, Emil Velikov wrote: > On 2019/05/25, Thomas Hellstrom wrote: > > On Sat, 2019-05-25 at 00:39 +0200, Thomas Hellström wrote: > > > Hi, Emil > > > > > > On Fri, 2019-05-24 at 16:26 +0100, Emil Velikov wrote: > >

Re: [PATCH 13/13] drm: allow render capable master with DRM_AUTH ioctls

2019-05-27 Thread Thomas Hellstrom
On 5/27/19 10:17 AM, Emil Velikov wrote: From: Emil Velikov There are cases (in mesa and applications) where one would open the primary node without properly authenticating the client. Sometimes we don't check if the authentication succeeds, but there's also cases we simply forget to do it. T

Re: [PATCH 4/5] drm/vmwgfx: remove custom ioctl io encoding check

2019-05-27 Thread Thomas Hellstrom
On 5/27/19 2:35 PM, Emil Velikov wrote: Hi Thomas, On 2019/05/27, Thomas Hellstrom wrote: I think we might be talking past each other, let's take a step back: - as of previous patch, all of vmwgfx ioctls size is consistently handled by the core I don't think I follow you he

Re: [PATCH 13/13] drm: allow render capable master with DRM_AUTH ioctls

2019-05-27 Thread Thomas Hellstrom
On 5/27/19 3:16 PM, Daniel Vetter wrote: On Mon, May 27, 2019 at 02:39:18PM +0200, Thomas Hellstrom wrote: On 5/27/19 10:17 AM, Emil Velikov wrote: From: Emil Velikov There are cases (in mesa and applications) where one would open the primary node without properly authenticating the client

Re: [PATCH 4/5] drm/vmwgfx: remove custom ioctl io encoding check

2019-05-27 Thread Thomas Hellstrom
On 5/27/19 5:27 PM, Emil Velikov wrote: On 2019/05/27, Thomas Hellstrom wrote: On 5/27/19 2:35 PM, Emil Velikov wrote: Hi Thomas, On 2019/05/27, Thomas Hellstrom wrote: I think we might be talking past each other, let's take a step back: - as of previous patch, all of vmwgfx ioctls

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-28 Thread Thomas Hellstrom
Hi, Tom, Could you shed some light on this? Thanks, Thomas On 5/24/19 5:08 PM, Alex Deucher wrote: + Tom He's been looking into SEV as well. On Fri, May 24, 2019 at 8:30 AM Thomas Hellstrom wrote: On 5/24/19 2:03 PM, Koenig, Christian wrote: Am 24.05.19 um 12:37 schrieb Thomas Hell

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-28 Thread Thomas Hellstrom
Hi, Tom, Thanks for the reply. The question is not graphics specific, but lies in your answer further below: On 5/28/19 4:48 PM, Lendacky, Thomas wrote: On 5/28/19 2:31 AM, Thomas Hellstrom wrote: Hi, Tom, Could you shed some light on this? I don't have a lot of GPU knowledge, so l

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-28 Thread Thomas Hellstrom
On Tue, 2019-05-28 at 15:50 +, Lendacky, Thomas wrote: > On 5/28/19 10:17 AM, Koenig, Christian wrote: > > Hi Thomas, > > > > Am 28.05.19 um 17:11 schrieb Thomas Hellstrom: > > > Hi, Tom, > > > > > > Thanks for the reply. The question is not

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-28 Thread Thomas Hellstrom
On 5/28/19 7:00 PM, Lendacky, Thomas wrote: On 5/28/19 11:32 AM, Koenig, Christian wrote: Am 28.05.19 um 18:27 schrieb Thomas Hellstrom: On Tue, 2019-05-28 at 15:50 +, Lendacky, Thomas wrote: On 5/28/19 10:17 AM, Koenig, Christian wrote: Hi Thomas, Am 28.05.19 um 17:11 schrieb Thomas

Re: [RFC PATCH] drm/ttm, drm/vmwgfx: Have TTM support AMD SEV encryption

2019-05-29 Thread Thomas Hellstrom
On Wed, 2019-05-29 at 09:50 +0200, Christian König wrote: > Am 28.05.19 um 19:23 schrieb Lendacky, Thomas: > > On 5/28/19 12:05 PM, Thomas Hellstrom wrote: > > > On 5/28/19 7:00 PM, Lendacky, Thomas wrote: > > > > On 5/28/19 11:32 AM, Koenig, Christian wrote: > >

[PATCH 0/9] Emulated coherent graphics memory

2019-04-12 Thread Thomas Hellstrom
Graphics APIs like OpenGL 4.4 and Vulkan require the graphics driver to provide coherent graphics memory, meaning that the GPU sees any content written to the coherent memory on the next GPU operation that touches that memory, and the CPU sees any content written by the GPU to that memory immediate

[PATCH 1/9] mm: Allow the [page|pfn]_mkwrite callbacks to drop the mmap_sem

2019-04-12 Thread Thomas Hellstrom
ack.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Thomas Hellstrom --- mm/memory.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index e11ca9dd823f..a95b4a3b1ae2 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2144,7 +2144,7 @@ static

[PATCH 2/9] mm: Add an apply_to_pfn_range interface

2019-04-12 Thread Thomas Hellstrom
ôme Glisse" Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Thomas Hellstrom --- include/linux/mm.h | 10 mm/memory.c| 130 ++--- 2 files changed, 108 insertions(+), 32 deletions(-) diff --git a/include/linux/mm.h

[PATCH 7/9] drm/vmwgfx: Use an RBtree instead of linked list for MOB resources

2019-04-12 Thread Thomas Hellstrom
With emulated coherent memory we need to be able to quickly look up a resource from the MOB offset. Instead of traversing a linked list with O(n) worst case, use an RBtree with O(log n) worst case complexity. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 5

[PATCH 6/9] drm/vmwgfx: Implement an infrastructure for write-coherent resources

2019-04-12 Thread Thomas Hellstrom
This infrastructure will, for coherent resources, make sure that from the user-space point of view, data written by the CPU is immediately automatically available to the GPU at resource validation time. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/Kconfig| 1

[PATCH 5/9] drm/ttm: TTM fault handler helpers

2019-04-12 Thread Thomas Hellstrom
ode into helpers: ttm_bo_vm_fault_reserved() and ttm_bo_vm_reserve(), and provide a default TTM fault handler for other drivers to use. Cc: "Christian König" Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 170 include/drm/ttm

[PATCH 8/9] drm/vmwgfx: Implement an infrastructure for read-coherent resources

2019-04-12 Thread Thomas Hellstrom
Similar to write-coherent resources, make sure that from the user-space point of view, GPU rendered contents is automatically available for reading by the CPU. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

[PATCH 9/9] drm/vmwgfx: Add surface dirty-tracking callbacks

2019-04-12 Thread Thomas Hellstrom
Add the callbacks necessary to implement emulated coherent memory for surfaces. Add a flag to the gb_surface_create ioctl to indicate that surface memory should be coherent. Also bump the drm minor version to signal the availability of coherent surfaces. Signed-off-by: Thomas Hellstrom

[PATCH 3/9] mm: Add write-protect and clean utilities for address space ranges

2019-04-12 Thread Thomas Hellstrom
r code about pending tlb flushes. Cc: Andrew Morton Cc: Matthew Wilcox Cc: Will Deacon Cc: Peter Zijlstra Cc: Rik van Riel Cc: Minchan Kim Cc: Michal Hocko Cc: Huang Ying Cc: Souptick Joarder Cc: "Jérôme Glisse" Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org S

[PATCH 4/9] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct

2019-04-12 Thread Thomas Hellstrom
Add a pointer to the struct vm_operations_struct in the bo_device, and assign that pointer to the default value currently used. The driver can then optionally modify that pointer and the new value can be used for each new vma created. Cc: "Christian König" Signed-off-by: Thomas

Re: [PATCH 2/9] mm: Add an apply_to_pfn_range interface

2019-04-13 Thread Thomas Hellstrom
Hi, Jérôme On Fri, 2019-04-12 at 17:07 -0400, Jerome Glisse wrote: > On Fri, Apr 12, 2019 at 04:04:18PM +0000, Thomas Hellstrom wrote: > > This is basically apply_to_page_range with added functionality: > > Allocating missing parts of the page table becomes optional, which >

Re: [PATCH 3/9] mm: Add write-protect and clean utilities for address space ranges

2019-04-13 Thread Thomas Hellstrom
Hi, Ralph, On Fri, 2019-04-12 at 11:52 -0700, Ralph Campbell wrote: > On 4/12/19 9:04 AM, Thomas Hellstrom wrote: > > Add two utilities to a) write-protect and b) clean all ptes > > pointing into > > a range of an address space > > A period at the end, please. >

Re: [PATCH 2/9] mm: Add an apply_to_pfn_range interface

2019-04-17 Thread Thomas Hellstrom
On Tue, 2019-04-16 at 10:46 -0400, Jerome Glisse wrote: > On Sat, Apr 13, 2019 at 08:34:02AM +0000, Thomas Hellstrom wrote: > > Hi, Jérôme > > > > On Fri, 2019-04-12 at 17:07 -0400, Jerome Glisse wrote: > > > On Fri, Apr 12, 2019 at 04:04:18PM +, Thomas He

Re: [PATCH 5/9] drm/ttm: TTM fault handler helpers

2019-04-17 Thread Thomas Hellstrom
On Mon, 2019-04-15 at 08:34 +0200, Christian König wrote: > Am 12.04.19 um 18:04 schrieb Thomas Hellstrom: > > With the vmwgfx dirty tracking, the default TTM fault handler is > > not > > completely sufficient (vmwgfx need to modify the vma->vm_flags > > member, >

Re: [PATCH 1/9] mm: Allow the [page|pfn]_mkwrite callbacks to drop the mmap_sem

2019-04-17 Thread Thomas Hellstrom
Hi, Souptick, On Sat, 2019-04-13 at 20:41 +0530, Souptick Joarder wrote: > On Fri, Apr 12, 2019 at 9:34 PM Thomas Hellstrom < > thellst...@vmware.com> wrote: > > Driver fault callbacks are allowed to drop the mmap_sem when > > expecting > > long hardware waits to

[PATCH] drm/vmwgfx: Fix dma API layer violation

2019-04-23 Thread Thomas Hellstrom
means that if anybody forces SWIOTLB without also setting the vmw_force_coherent=1 vmwgfx option, driver operation will fail, like it will on most other graphics drivers. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 33 + 1 file chang

Re: [PATCH 6/9] drm/vmwgfx: Implement an infrastructure for write-coherent resources

2019-04-24 Thread Thomas Hellstrom
On Mon, 2019-04-22 at 18:54 +, Deepak Singh Rawat wrote: > Hi Thomas, > > With minor comments below > > Reviewed-by: Deepak Rawat > Thanks for reviewing Deepak, Some comments below: > On Fri, 2019-04-12 at 09:04 -0700, Thomas Hellstrom wrote: > > This infras

Re: [PATCH 8/9] drm/vmwgfx: Implement an infrastructure for read-coherent resources

2019-04-24 Thread Thomas Hellstrom
On Mon, 2019-04-22 at 20:12 +, Deepak Singh Rawat wrote: > Minor nits below, otherwise > > Reviewed-by: Deepak Rawat > > On Fri, 2019-04-12 at 09:04 -0700, Thomas Hellstrom wrote: > > Similar to write-coherent resources, make sure that from the user- > > s

[PATCH 2/9] mm: Add an apply_to_pfn_range interface v2

2019-04-24 Thread Thomas Hellstrom
ôme Glisse" Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Thomas Hellstrom Reviewed-by: Ralph Campbell #v1 --- v2: Clearly warn people from using apply_to_pfn_range and apply_to_page_range unless they know what they are doing. --- include/linux/mm.h | 10 ++

[PATCH 1/9] mm: Allow the [page|pfn]_mkwrite callbacks to drop the mmap_sem v2

2019-04-24 Thread Thomas Hellstrom
ack.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Thomas Hellstrom Reviewed-by: Ralph Campbell --- v2: Make the order error codes we check for consistent with the order used in the rest of the file. --- mm/memory.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

[PATCH 7/9] drm/vmwgfx: Use an RBtree instead of linked list for MOB resources

2019-04-24 Thread Thomas Hellstrom
With emulated coherent memory we need to be able to quickly look up a resource from the MOB offset. Instead of traversing a linked list with O(n) worst case, use an RBtree with O(log n) worst case complexity. Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat --- drivers/gpu/drm/vmwgfx

[PATCH 5/9] drm/ttm: TTM fault handler helpers v2

2019-04-24 Thread Thomas Hellstrom
ode into helpers: ttm_bo_vm_fault_reserved() and ttm_bo_vm_reserve(), and provide a default TTM fault handler for other drivers to use. Cc: "Christian König" Signed-off-by: Thomas Hellstrom Reviewed-by: "Christian König" #v1 --- v2: Remove some unnecessary code pointed out in r

[PATCH 8/9] drm/vmwgfx: Implement an infrastructure for read-coherent resources v2

2019-04-24 Thread Thomas Hellstrom
Similar to write-coherent resources, make sure that from the user-space point of view, GPU rendered contents is automatically available for reading by the CPU. Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat --- v2: Comment- and formatting fixes. --- drivers/gpu/drm/vmwgfx

[PATCH 4/9] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct

2019-04-24 Thread Thomas Hellstrom
Add a pointer to the struct vm_operations_struct in the bo_device, and assign that pointer to the default value currently used. The driver can then optionally modify that pointer and the new value can be used for each new vma created. Cc: "Christian König" Signed-off-by: Thomas

[PATCH 0/9] Emulated coherent graphics memory v2

2019-04-24 Thread Thomas Hellstrom
Graphics APIs like OpenGL 4.4 and Vulkan require the graphics driver to provide coherent graphics memory, meaning that the GPU sees any content written to the coherent memory on the next GPU operation that touches that memory, and the CPU sees any content written by the GPU to that memory immediate

[PATCH 3/9] mm: Add write-protect and clean utilities for address space ranges v2

2019-04-24 Thread Thomas Hellstrom
r code about pending tlb flushes. Cc: Andrew Morton Cc: Matthew Wilcox Cc: Will Deacon Cc: Peter Zijlstra Cc: Rik van Riel Cc: Minchan Kim Cc: Michal Hocko Cc: Huang Ying Cc: Souptick Joarder Cc: "Jérôme Glisse" Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Signed-off-

[PATCH 9/9] drm/vmwgfx: Add surface dirty-tracking callbacks v2

2019-04-24 Thread Thomas Hellstrom
Add the callbacks necessary to implement emulated coherent memory for surfaces. Add a flag to the gb_surface_create ioctl to indicate that surface memory should be coherent. Also bump the drm minor version to signal the availability of coherent surfaces. Signed-off-by: Thomas Hellstrom Reviewed

[PATCH 6/9] drm/vmwgfx: Implement an infrastructure for write-coherent resources v2

2019-04-24 Thread Thomas Hellstrom
This infrastructure will, for coherent resources, make sure that from the user-space point of view, data written by the CPU is immediately automatically available to the GPU at resource validation time. Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat --- v2: Minor documentation- and

Re: [PATCH 4/9] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct

2019-04-24 Thread Thomas Hellstrom
On Wed, 2019-04-24 at 14:10 +, Koenig, Christian wrote: > Am 24.04.19 um 14:00 schrieb Thomas Hellstrom: > > Add a pointer to the struct vm_operations_struct in the bo_device, > > and > > assign that pointer to the default value currently used. > > > > The

[git pull] vmwgfx-fixes-5.1

2019-04-25 Thread Thomas Hellstrom
: git://people.freedesktop.org/~thomash/linux vmwgfx-fixes-5.1 for you to fetch changes up to 81103355b1e23345dbcdeccad59962a424da4a34: drm/vmwgfx: Fix dma API layer violation (2019-04-25 09:05:03 +0200) ---- Thomas Hellstrom (1):

Re: [PATCH 4/9] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct

2019-04-25 Thread Thomas Hellstrom
Hi, Christian, On Wed, 2019-04-24 at 16:20 +0200, Thomas Hellström wrote: > On Wed, 2019-04-24 at 14:10 +, Koenig, Christian wrote: > > Am 24.04.19 um 14:00 schrieb Thomas Hellstrom: > > > Add a pointer to the struct vm_operations_struct in the > > > bo_device,

[git pull] vmwgfx-fixes-5.1

2019-04-25 Thread Thomas Hellstrom
: git://people.freedesktop.org/~thomash/linux vmwgfx-fixes-5.1 for you to fetch changes up to 81103355b1e23345dbcdeccad59962a424da4a34: drm/vmwgfx: Fix dma API layer violation (2019-04-25 09:05:03 +0200) ---- Thomas Hellstrom (1):

Re: [PATCH] Revert "drm/qxl: drop prime import/export callbacks"

2019-04-26 Thread Thomas Hellstrom
On 4/26/19 4:21 PM, Daniel Vetter wrote: On Fri, Apr 26, 2019 at 7:33 AM Gerd Hoffmann wrote: This reverts commit f4c34b1e2a37d5676180901fa6ff188bcb6371f8. Simliar to commit a0cecc23cfcb Revert "drm/virtio: drop prime import/export callbacks". We have to do the same with qxl, for the same rea

[PATCH 3/9] mm: Add write-protect and clean utilities for address space ranges v3

2019-04-27 Thread Thomas Hellstrom
r code about pending tlb flushes. Cc: Andrew Morton Cc: Matthew Wilcox Cc: Will Deacon Cc: Peter Zijlstra Cc: Rik van Riel Cc: Minchan Kim Cc: Michal Hocko Cc: Huang Ying Cc: Souptick Joarder Cc: "Jérôme Glisse" Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org S

[PATCH 0/4] Fix DMA ops layering violations in vmwgfx v2

2019-01-25 Thread Thomas Hellstrom
This is a patch set from Christoph Hellwig. Patch 2 has been updated by me to not remove checks for TTM coherent pool presence. Ideally, we should query TTM for this instead and I'll have a patch set intended for 5.1 so that we can do that. But I don't want to introduce cross-module API additions o

[PATCH 4/4] drm/vmwgfx: unwind spaghetti code in vmw_dma_select_mode

2019-01-25 Thread Thomas Hellstrom
From: Christoph Hellwig Just use a simple if/else chain to select the DMA mode. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 25 ++--- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers

[PATCH 3/4] drm/vmwgfx: fix the check when to use dma_alloc_coherent

2019-01-25 Thread Thomas Hellstrom
From: Christoph Hellwig Since Linux 4.21 we merged the swiotlb ops into the DMA direct ops, so they would always have a the sync_single methods. But late in the cicle we also removed the direct ops entirely, so we'd see NULL DMA ops. Switch vmw_dma_select_mode to only detect swiotlb presence us

[PATCH 2/4] drm/vmwgfx: remove CONFIG_INTEL_IOMMU ifdefs v2

2019-01-25 Thread Thomas Hellstrom
From: Christoph Hellwig intel_iommu_enabled is defined as always false for !CONFIG_INTEL_IOMMU, so remove the ifdefs around it. Signed-off-by: Christoph Hellwig Reviewed-by: Thomas Hellstrom --- v2: Retain the check for TTM dma page pool presence. --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 21

[PATCH 1/4] drm/vmwgfx: remove CONFIG_X86 ifdefs

2019-01-25 Thread Thomas Hellstrom
From: Christoph Hellwig The driver depends on CONFIG_X86 so these are dead code. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 25

[PATCH -fixes] drm/vmwgfx: Improve on IOMMU detection

2019-01-25 Thread Thomas Hellstrom
instead of relying on intel_iommu_enabled, use the fact that the dma_map:ops::map_page != dma_direct_map_page. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx

[PATCH 2/2] drm/vmwgfx: Use ttm_dma_page_alloc_enabled

2019-01-25 Thread Thomas Hellstrom
Instead of guessing whether TTM has the dma page allocator enabled, ask TTM. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

[PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled

2019-01-25 Thread Thomas Hellstrom
The vmwgfx driver needs to know whether the dma page pool is enabled to determine whether to refuse loading if the dma mode logic requests coherent memory from the dma page pool. Cc: "Koenig, Christian" Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_page_alloc_

Re: [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled

2019-01-28 Thread Thomas Hellstrom
Hi, On Mon, 2019-01-28 at 12:21 +, Koenig, Christian wrote: > Am 25.01.19 um 14:05 schrieb Thomas Hellstrom: > > The vmwgfx driver needs to know whether the dma page pool is > > enabled > > to determine whether to refuse loading if the dma mode logic > > requests c

Re: [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled

2019-01-28 Thread Thomas Hellstrom
On Mon, 2019-01-28 at 14:29 +0100, Thomas Hellström wrote: > Hi, > > On Mon, 2019-01-28 at 12:21 +, Koenig, Christian wrote: > > Am 25.01.19 um 14:05 schrieb Thomas Hellstrom: > > > The vmwgfx driver needs to know whether the dma page pool is > > > enabled >

[PATCH 1/2] drm/vmwgfx: Fix an uninitialized fence handle value

2019-01-29 Thread Thomas Hellstrom
if vmw_execbuf_fence_commands() fails, The handle value will be uninitialized and a bogus fence handle might be copied to user-space. Cc: Fixes: 2724b2d54cda: ("drm/vmwgfx: Use new validation interface for the modesetting code v2") Reported-by: Dan Carpenter Signed-off-by: Thomas

[PATCH 2/2] drm/vmwgfx: Also check for crtc status while checking for DU active

2019-01-29 Thread Thomas Hellstrom
ayout race condition") Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmw

[PATCH 1/2] drm/vmwgfx: Fix setting of dma masks

2019-01-29 Thread Thomas Hellstrom
Previously we set only the dma mask and not the coherent mask. Fix that. Also, for clarity, make sure both are initially set to 64 bits. Fixes: 0d00c488f3de: ("drm/vmwgfx: Fix the driver for large dma addresses") Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx

[PATCH v2 2/2] drm/vmwgfx: Improve on IOMMU detection

2019-01-29 Thread Thomas Hellstrom
instead of relying on intel_iommu_enabled, use the fact that the dma_map_ops::map_page != dma_direct_map_page. Signed-off-by: Thomas Hellstrom --- v2: Merge fixes and typo fix in commit message. Also check for ops being non-NULL before dereferencing it. --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Re: [PATCH 2/2] drm/vmwgfx: Use ttm_dma_page_alloc_enabled

2019-01-30 Thread Thomas Hellstrom
Hi, Sam, On 01/25/2019 07:22 PM, Sam Ravnborg wrote: Hi Thomas. One little nit, and an improvment proposal (for another patch/day). On Fri, Jan 25, 2019 at 02:05:48PM +0100, Thomas Hellstrom wrote: Instead of guessing whether TTM has the dma page allocator enabled, ask TTM. Signed-off-by

[git pull] vmwgfx-fixes-5.0-190130

2019-01-30 Thread Thomas Hellstrom
fx: remove CONFIG_INTEL_IOMMU ifdefs v2 drm/vmwgfx: fix the check when to use dma_alloc_coherent drm/vmwgfx: unwind spaghetti code in vmw_dma_select_mode Deepak Rawat (1): drm/vmwgfx: Also check for crtc status while checking for DU active Thomas Hellstrom (1): drm/vmwgfx: Fix an uninitial

Re: [git pull] vmwgfx-fixes-5.0-190130

2019-01-30 Thread Thomas Hellstrom
Hi, On 1/30/19 11:55 AM, Thomas Hellstrom wrote: Dave, Daniel A fix for a DMA API change from Christoph Hellwig for vmwgfx, and Two stable fixes for regressions in the vmwgfx driver The following changes since commit f0e7ce1eef5854584dfb59b3824a67edee37580f: Merge tag 'drm-msm-fixes

[PATCH v2] drm/vmwgfx: Fix an uninitialized fence handle value

2019-01-31 Thread Thomas Hellstrom
if vmw_execbuf_fence_commands() fails, The handle value will be uninitialized and a bogus fence handle might be copied to user-space. Fixes: 2724b2d54cda: ("drm/vmwgfx: Use new validation interface for the modesetting code v2") Reported-by: Dan Carpenter Signed-off-by: Thomas

[PATCH] drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user

2019-01-31 Thread Thomas Hellstrom
-zero error code if the fence pointer returned is NULL. Fixes: ae2a104058e2: ("vmwgfx: Implement fence objects") Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx

Re: [PATCH 2/4] drm/vmwgfx: remove CONFIG_INTEL_IOMMU ifdefs v2

2019-02-04 Thread Thomas Hellstrom
On Mon, 2019-02-04 at 09:19 +0100, Christoph Hellwig wrote: > On Fri, Jan 25, 2019 at 09:12:13AM +0100, Thomas Hellstrom wrote: > > -#if !defined(CONFIG_SWIOTLB) && !defined(CONFIG_INTEL_IOMMU) > > - /* > > -* No coherent page pool > > -

[git pull] vmwgfx-next-2018-12-13

2019-02-06 Thread Thomas Hellstrom
Hi, Dave Two minor fixes for the previous vmwgfx-next pull: The following changes since commit 9a01135b98b9d5a7033c544245da7aad0d886758: drm/vmwgfx: Use the standard atomic helpers for page-flip (2018-12-05 10:09:55 +0100) are available in the Git repository at: git://people.freedesktop.o

Re: [git pull] vmwgfx-next-2018-12-13

2019-02-06 Thread Thomas Hellstrom
Old pull message. Please ignore. The correct one coming up. /Thomas On Wed, 2019-02-06 at 20:42 +0100, Thomas Hellstrom wrote: > Hi, Dave > > Two minor fixes for the previous vmwgfx-next pull: > > The following changes since commit > 9a01135b98b9d5a7033c544245da7aad0d

[git pull] vmwgfx-fixes-5.0-2

2019-02-06 Thread Thomas Hellstrom
gfx: Also check for crtc status while checking for DU active Thomas Hellstrom (4): drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user drm/vmwgfx: Fix an uninitialized fence handle value drm/vmwgfx: Fix setting of dma masks drm/vmwgfx: Improve on IOMMU detection

Re: [PATCH 2/5] drm/ttm: Define a single DRM_FILE_PAGE_OFFSET constant

2019-02-07 Thread Thomas Hellstrom
On Thu, 2019-02-07 at 09:59 +0100, Thomas Zimmermann wrote: > Most TTM drivers define the constant DRM_FILE_PAGE_OFFSET of the same > value. The only exception is vboxvideo, which is being converted to > the > new offset by this patch. Unifying the constants in a single place > simplifies the drive

  1   2   3   4   5   6   7   8   9   10   >