Re: [PATCH] drm/cirrus: fix connector leak at unload

2019-01-16 Thread Gerd Hoffmann
On Fri, Jan 11, 2019 at 11:16:38PM +0100, Daniel Vetter wrote: > On Fri, Jan 11, 2019 at 11:06:20PM +0100, Daniel Vetter wrote: > > On Fri, Jan 11, 2019 at 09:02:34AM -0500, Rob Clark wrote: > > > This fixes an '*ERROR* connector VGA-2 leaked!' splat at driver unload. > > > > > > Signed-off-by:

[PATCH v4 05/16] drm/bochs: atomic: switch planes to atomic, wire up helpers.

2019-01-16 Thread Gerd Hoffmann
Conversion to atomic modesetting, step three. Wire up atomic helpers. Switch planes to atomic. We are late to the party, the transitional helpers are gone, so this can't be splitted into smaller steps any more. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel

[PATCH v4 10/16] drm/bochs: remove old bochs_crtc_* functions

2019-01-16 Thread Gerd Hoffmann
Remove the old, now unused crtc callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 81 --- 1 file changed, 81 deletions(-) diff --git a/drivers/gpu/drm/bochs

[PATCH v4 08/16] drm/bochs: atomic: use suspend/resume helpers

2019-01-16 Thread Gerd Hoffmann
Switch to atomic helpers: drm_mode_config_helper_suspend/resume(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index

[PATCH v4 15/16] drm/bochs: drop old fbdev emulation code

2019-01-16 Thread Gerd Hoffmann
Not needed any more, bochs uses the generic emulation now. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 9 --- drivers/gpu/drm/bochs/bochs_fbdev.c | 129 2 files

[PATCH v4 16/16] drm/bochs: move remaining fb bits to kms

2019-01-16 Thread Gerd Hoffmann
bochs_fbdev.c is almost empty now. Move the remaining framebuffer bits over to bochs_kms.c. Pure code motion. No functional change. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_fbdev.c | 29

[PATCH v4 09/16] drm/bochs: atomic: set DRIVER_ATOMIC

2019-01-16 Thread Gerd Hoffmann
Conversion to atomic modesetting, final step. Set the DRIVER_ATOMIC flag. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs

[PATCH v4 03/16] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks.

2019-01-16 Thread Gerd Hoffmann
Conversion to atomic modesetting, step one. Add atomic crtc helper callbacks. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers

[PATCH v4 02/16] drm/bochs: split bochs_hw_setmode

2019-01-16 Thread Gerd Hoffmann
Create a separate bochs_hw_setformat function to configure the framebuffer format (actually just the byteorder). Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 5 +++-- drivers/gpu/drm/bochs/bochs_hw.c | 19

[PATCH v4 13/16] drm/bochs: add basic prime support

2019-01-16 Thread Gerd Hoffmann
Just enough to make the generic framebuffer emulation happy. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 7 ++ drivers/gpu/drm/bochs/bochs_drv.c | 11 - drivers/gpu/drm/bochs/bochs_mm.c | 49

[PATCH v4 01/16] drm/bochs: encoder cleanup

2019-01-16 Thread Gerd Hoffmann
Most unused callbacks can be NULL pointers these days. Drop a bunch of empty encoder callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 26 -- 1 file changed, 26 deletions

[PATCH v4 07/16] drm/bochs: atomic: use atomic page_flip helper

2019-01-16 Thread Gerd Hoffmann
Conversion to atomic modesetting, step five. Use atomic page_flip helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions

[PATCH v4 06/16] drm/bochs: atomic: use atomic set_config helper

2019-01-16 Thread Gerd Hoffmann
Conversion to atomic modesetting, step four. Use atomic set_config helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu

Re: [Spice-devel] [PATCH 1/3] drm/qxl: add mode/framebuffer check functions

2019-01-16 Thread Gerd Hoffmann
> > +static int qxl_check_mode(struct qxl_device *qdev, > > + unsigned int width, > > + unsigned int height) > > +{ > > + if (width * height * 4 > qdev->vram_size) > > Is someone checking for integer overflows already? Need to have a look. This is just

[PATCH 3/3] drm/qxl: use kernel mode db

2019-01-16 Thread Gerd Hoffmann
Add all standard modes from the kernel's video mode data base. Keep a few non-standard modes in the qxl mode list. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 27 +++ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 2/3] drm/qxl: add qxl_add_mode helper function

2019-01-16 Thread Gerd Hoffmann
Add a helper function to add custom video modes to a connector. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 84 +++ 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm

[PATCH] drm/virtio: drop prime import/export callbacks

2019-01-10 Thread Gerd Hoffmann
Also set prime_handle_to_fd and prime_fd_to_handle to NULL, so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to userspace. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 drivers/gpu/drm/virtio/virtgpu_drv.c | 4 drivers/gpu/drm/virtio

Re: [PATCH v3 14/15] drm/bochs: drop old fbdev emulation code

2019-01-10 Thread Gerd Hoffmann
Hi, > > - drm_fb_helper_set_suspend_unlocked(>fb.helper, 1); > > The generic fbdev emulation doesn't take care of suspend/resume. You > could do this: > drm_fb_helper_set_suspend_unlocked(drm_dev->fb_helper, 1); Additional to drm_mode_config_helper_suspend() I assume? Does the call order

[PATCH v3 11/15] drm/bochs: move ttm_bo_(un)reserve calls into bochs_bo_{pin, unpin}

2019-01-10 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_fbdev.c | 8 drivers/gpu/drm/bochs/bochs_kms.c | 14 +- drivers/gpu/drm/bochs/bochs_mm.c| 8 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v3 12/15] drm/bochs: add basic prime support

2019-01-10 Thread Gerd Hoffmann
Just enough to make the generic framebuffer emulation happy. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 7 ++ drivers/gpu/drm/bochs/bochs_drv.c | 11 - drivers/gpu/drm/bochs/bochs_mm.c | 49

[PATCH v3 08/15] drm/bochs: atomic: set DRIVER_ATOMIC

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, final step. Set the DRIVER_ATOMIC flag. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs

[PATCH v3 05/15] drm/bochs: atomic: switch planes to atomic, wire up helpers.

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step three. Wire up atomic helpers. Switch planes to atomic. We are late to the party, the transitional helpers are gone, so this can't be splitted into smaller steps any more. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel

[PATCH v3 15/15] drm/bochs: move remaining fb bits to kms

2019-01-10 Thread Gerd Hoffmann
bochs_fbdev.c is almost empty now. Move the remaining framebuffer bits over to bochs_kms.c. Pure code motion. No functional change. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_fbdev.c | 29

[PATCH v3 04/15] drm/bochs: atomic: add mode_set_nofb callback.

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step two. Add mode_set_nofb crtc helper callback. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm

[PATCH v3 14/15] drm/bochs: drop old fbdev emulation code

2019-01-10 Thread Gerd Hoffmann
Not needed any more, bochs uses the generic emulation now. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 9 --- drivers/gpu/drm/bochs/bochs_drv.c | 6 -- drivers/gpu/drm/bochs/bochs_fbdev.c | 129

[PATCH v3 13/15] drm/bochs: switch to generic drm fbdev emulation

2019-01-10 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_drv.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 379111f5a0..1d86c0fb5f 100644 --- a/drivers/gpu/drm

[PATCH v3 09/15] drm/bochs: remove old bochs_crtc_* functions

2019-01-10 Thread Gerd Hoffmann
Remove the old, now unused crtc callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 81 --- 1 file changed, 81 deletions(-) diff --git a/drivers/gpu/drm/bochs

[PATCH v3 10/15] drm/bochs: drop unused gpu_addr arg from bochs_bo_pin()

2019-01-10 Thread Gerd Hoffmann
It's always NULL, so just remove it. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- drivers/gpu/drm/bochs

[PATCH v3 02/15] drm/bochs: split bochs_hw_setmode

2019-01-10 Thread Gerd Hoffmann
Create a separate bochs_hw_setformat function to configure the framebuffer format (actually just the byteorder). Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 5 +++-- drivers/gpu/drm/bochs/bochs_hw.c | 19

[PATCH v3 06/15] drm/bochs: atomic: use atomic set_config helper

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step four. Use atomic set_config helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH v3 01/15] drm/bochs: encoder cleanup

2019-01-10 Thread Gerd Hoffmann
Most unused callbacks can be NULL pointers these days. Drop a bunch of empty encoder callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 26 -- 1 file changed, 26 deletions

[PATCH v3 03/15] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks.

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step one. Add atomic crtc helper callbacks. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers

[PATCH v3 07/15] drm/bochs: atomic: use atomic page_flip helper

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step five. Use atomic page_flip helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions

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

2019-01-10 Thread Gerd Hoffmann
Also set prime_handle_to_fd and prime_fd_to_handle to NULL, so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to userspace. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 4 drivers/gpu/drm/qxl/qxl_prime.c | 14 -- 2 files changed, 18 deletions

Re: [PATCH v2 15/15] drm/bochs: reserve bo for pin/unpin

2019-01-09 Thread Gerd Hoffmann
Hi, > > If I understand things correctly it is valid to set all import/export > > callbacks (prime_handle_to_fd, prime_fd_to_handle, > > gem_prime_get_sg_table, gem_prime_import_sg_table) to NULL when not > > supporting dma-buf import/export and still advertise DRIVER_PRIME to > > indicate the

Re: [PATCH v2 15/15] drm/bochs: reserve bo for pin/unpin

2019-01-09 Thread Gerd Hoffmann
On Wed, Jan 09, 2019 at 11:10:44AM +0100, Daniel Vetter wrote: > On Tue, Jan 08, 2019 at 12:25:19PM +0100, Gerd Hoffmann wrote: > > The buffer object must be reserved before calling > > ttm_bo_validate for pinning/unpinning. > > > > Signed-off-by: Gerd Hoffmann >

Re: [PATCH] qxl: Use struct_size() in kzalloc()

2019-01-09 Thread Gerd Hoffmann
On Tue, Jan 08, 2019 at 10:21:52AM -0600, Gustavo A. R. Silva wrote: > One of the more common cases of allocation size calculations is finding the > size of a structure that has a zero-sized array at the end, along with memory > for some number of elements for that array. For example: > > struct

Re: [PATCH v2] drm/virtio: Drop deprecated load/unload initialization

2019-01-09 Thread Gerd Hoffmann
On Tue, Jan 08, 2019 at 11:59:30AM -0300, Ezequiel Garcia wrote: > Move the code around so the driver is probed the bus > .probe and removed from the bus .remove callbacks. > This commit is just a cleanup and shouldn't affect > functionality. That one works. thanks, Gerd

[PATCH v2 08/15] drm/bochs: atomic: set DRIVER_ATOMIC

2019-01-08 Thread Gerd Hoffmann
Conversion to atomic modesetting, final step. Set the DRIVER_ATOMIC flag. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu

[PATCH v2 05/15] drm/bochs: atomic: switch planes to atomic, wire up helpers.

2019-01-08 Thread Gerd Hoffmann
Conversion to atomic modesetting, step three. Wire up atomic helpers. Switch planes to atomic. We are late to the party, the transitional helpers are gone, so this can't be splitted into smaller steps any more. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu

[PATCH v2 13/15] drm/bochs: drop old fbdev emulation code

2019-01-08 Thread Gerd Hoffmann
Not needed any more, bochs uses the generic emulation now. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs.h | 9 --- drivers/gpu/drm/bochs/bochs_drv.c | 6 -- drivers/gpu/drm/bochs/bochs_fbdev.c | 137

[PATCH v2 10/15] drm/bochs: drop unused gpu_addr arg from bochs_bo_pin()

2019-01-08 Thread Gerd Hoffmann
It's always NULL, so just remove it. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- drivers/gpu/drm/bochs/bochs_mm.c| 11

[PATCH v2 11/15] drm/bochs: add basic prime support

2019-01-08 Thread Gerd Hoffmann
Generic framebuffer emulation needs this. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs.h | 11 +++ drivers/gpu/drm/bochs/bochs_drv.c | 15 +- drivers/gpu/drm/bochs/bochs_mm.c | 63 +++ 3

[PATCH v2 12/15] drm/bochs: switch to generic drm fbdev emulation

2019-01-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index a9c7140e3b..350e34cf2c 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b

[PATCH v2 15/15] drm/bochs: reserve bo for pin/unpin

2019-01-08 Thread Gerd Hoffmann
The buffer object must be reserved before calling ttm_bo_validate for pinning/unpinning. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_mm.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c index

[PATCH v2 09/15] drm/bochs: remove old bochs_crtc_* functions

2019-01-08 Thread Gerd Hoffmann
Remove the old, now unused crtc callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 81 --- 1 file changed, 81 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm

[PATCH v2 07/15] drm/bochs: atomic: use atomic page_flip helper

2019-01-08 Thread Gerd Hoffmann
Conversion to atomic modesetting, step five. Use atomic page_flip helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 14/15] drm/bochs: move remaining fb bits to kms

2019-01-08 Thread Gerd Hoffmann
bochs_fbdev.c is almost empty now. Move the remaining framebuffer bits over to bochs_kms.c. Pure code motion. No functional change. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_fbdev.c | 29 - drivers/gpu/drm

[PATCH v2 04/15] drm/bochs: atomic: add mode_set_nofb callback.

2019-01-08 Thread Gerd Hoffmann
Conversion to atomic modesetting, step two. Add mode_set_nofb crtc helper callback. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers

[PATCH v2 01/15] drm/bochs: encoder cleanup

2019-01-08 Thread Gerd Hoffmann
Most unused callbacks can be NULL pointers these days. Drop a bunch of empty encoder callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 06/15] drm/bochs: atomic: use atomic set_config helper

2019-01-08 Thread Gerd Hoffmann
Conversion to atomic modesetting, step four. Use atomic set_config helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b

[PATCH v2 02/15] drm/bochs: split bochs_hw_setmode

2019-01-08 Thread Gerd Hoffmann
Create a separate bochs_hw_setformat function to configure the framebuffer format (actually just the byteorder). Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs.h | 5 +++-- drivers/gpu/drm/bochs/bochs_hw.c | 19

[PATCH v2 03/15] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks.

2019-01-08 Thread Gerd Hoffmann
Conversion to atomic modesetting, step one. Add atomic crtc helper callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c

Re: [PATCH] drm/virtio: Drop deprecated load/unload initialization

2019-01-08 Thread Gerd Hoffmann
On Thu, Jan 03, 2019 at 01:16:00PM -0300, Ezequiel Garcia wrote: > Move the code around so the driver is probed the bus > .probe and removed from the bus .remove callbacks. > This commit is just a cleanup and shouldn't affect > functionality. Doesn't apply cleanly to drm-misc-next, and git can't

Re: [PATCH] drm/virtio: Remove incorrect kfree()

2019-01-08 Thread Gerd Hoffmann
On Wed, Jan 02, 2019 at 02:55:06PM -0300, Ezequiel Garcia wrote: > The virtio_gpu_output is a member of struct virtio_gpu_device > and is not a dynamically-allocated chunk, so it's wrong to kfree() it. > Removing it fixes a memory corruption BUG() that can be triggered > when the virtio-gpu driver

[PATCH v3] drm/bochs: add edid present check

2018-12-20 Thread Gerd Hoffmann
Check header before trying to read the complete edid blob, to avoid the log being spammed in case qemu has no edid support (old qemu or edid support turned off). Fixes: 01f23459cf drm/bochs: add edid support. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 7 +++ 1 file

[PATCH v2] drm/bochs: add edid present check

2018-12-19 Thread Gerd Hoffmann
Check first two header bytes before trying to read the edid blob, to avoid the log being spammed in case qemu has no edid support (old qemu or edid turned off). Fixes: 01f23459cf drm/bochs: add edid support. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 8 1 file

Re: [PATCH] drm/bochs: add edid present check

2018-12-19 Thread Gerd Hoffmann
Hi, > You could probably have a comment here explaining the magic below > (just like in the commit message to ease the task of understanding > while reading the code why 2 of 8 bytes of the EDID header is checked > and why it is all needed). Of course one can use git blame... Up to you Makes

[PATCH 08/10] drm/virtio: drop fencing in virtio_gpu_resource_create_ioctl

2018-12-19 Thread Gerd Hoffmann
There is no need to wait for completion here. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 51 +- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio

[PATCH 05/10] drm/virtio: use struct to pass params to virtio_gpu_object_create()

2018-12-19 Thread Gerd Hoffmann
Create virtio_gpu_object_params, use that to pass object parameters to virtio_gpu_object_create. Also drop unused "kernel" parameter (unused, always false). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 15 ++- drivers/gpu/drm/virtio/vir

[PATCH 07/10] drm/virtio: params struct for virtio_gpu_cmd_create_resource_3d()

2018-12-19 Thread Gerd Hoffmann
Add 3d resource parameters to virtio_gpu_object_params struct and use it for virtio_gpu_cmd_resource_create_3d() calls. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 10 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 25 ++--- drivers/gpu/drm

[PATCH 02/10] drm/virtio: fix pageflip flush

2018-12-19 Thread Gerd Hoffmann
Sending the flush command only makes sense if we actually have a framebuffer attached to the scanout (handle != 0). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/virtio

[PATCH 04/10] drm/virtio: move virtio_gpu_object_{attach, detach} calls.

2018-12-19 Thread Gerd Hoffmann
and move_notify callbacks are not needed any more, so drop them. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ttm.c | 92 ++-- 1 file changed, 24 insertions(+), 68 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm

[PATCH 09/10] drm/virtio: move virtio_gpu_cmd_create_resource call into virtio_gpu_object_create

2018-12-19 Thread Gerd Hoffmann
Specifically call virtio_gpu_object_create() before ttm_bo_init(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 2 ++ drivers/gpu/drm/virtio/virtgpu_gem.c| 3 +-- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 10 ++ drivers/gpu/drm/virtio/virtgpu_object.c

[PATCH 10/10] drm/virtio: ditch virtio_gpu_object_attach() calls

2018-12-19 Thread Gerd Hoffmann
With virtio_gpu_object_create() being called earlier ttm_bo_init() will handle the virtio_gpu_object_attach() (via backend binding), so we can drop the extra calls now. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_gem.c | 9 - drivers/gpu/drm/virtio/virtgpu_ioctl.c

[PATCH 01/10] drm/virtio: log error responses

2018-12-19 Thread Gerd Hoffmann
If we got an error response code from the host, print it to the log. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c

[PATCH 03/10] drm/virtio: drop virtio_gpu_fence_cleanup()

2018-12-19 Thread Gerd Hoffmann
Just call drm_fence_put directly instead. Also set vgfb->fence to NULL after dropping the reference. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_fence.c | 8 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- drivers/gpu/

[PATCH 06/10] drm/virtio: params struct for virtio_gpu_cmd_create_resource()

2018-12-19 Thread Gerd Hoffmann
Add format, width and height to the virtio_gpu_object_params struct and use the struct for virtio_gpu_cmd_create_resource(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 7 --- drivers/gpu/drm/virtio/virtgpu_gem.c | 8 drivers/gpu/drm/virtio

[PATCH 13/14] drm/bochs: drop old fbdev emulation code

2018-12-19 Thread Gerd Hoffmann
Not needed any more, bochs uses the generic emulation now. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 9 --- drivers/gpu/drm/bochs/bochs_drv.c | 6 -- drivers/gpu/drm/bochs/bochs_fbdev.c | 137 3 files changed, 152 deletions

[PATCH 07/14] drm/bochs: atomic: use atomic page_flip helper

2018-12-19 Thread Gerd Hoffmann
Conversion to atomic modesetting, step five. Use atomic page_flip helper for crtc. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm

[PATCH 11/14] drm/bochs: add basic prime support

2018-12-19 Thread Gerd Hoffmann
Generic framebuffer emulation needs this. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 11 +++ drivers/gpu/drm/bochs/bochs_drv.c | 15 +- drivers/gpu/drm/bochs/bochs_mm.c | 63 +++ 3 files changed, 88 insertions(+), 1

[PATCH 14/14] drm/bochs: move remaining fb bits to kms

2018-12-19 Thread Gerd Hoffmann
bochs_fbdev.c is almost empty now. Move the remaining framebuffer bits over to bochs_kms.c. Pure code motion. No functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_fbdev.c | 29 - drivers/gpu/drm/bochs/bochs_kms.c | 17

[PATCH 09/14] drm/bochs: remove old bochs_crtc_* functions

2018-12-19 Thread Gerd Hoffmann
Remove the old, now unused crtc callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 81 --- 1 file changed, 81 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index 9e836386e9

[PATCH 10/14] drm/bochs: drop unused gpu_addr arg from bochs_bo_pin()

2018-12-19 Thread Gerd Hoffmann
It's always NULL, so just remove it. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- drivers/gpu/drm/bochs/bochs_mm.c| 11 +-- 4 files changed, 4 insertions(+), 13

[PATCH 05/14] drm/bochs: atomic: switch planes to atomic, wire up helpers.

2018-12-19 Thread Gerd Hoffmann
Conversion to atomic modesetting, step three. Wire up atomic helpers. Switch planes to atomic. We are late to the party, the transitional helpers are gone, so this can't be splitted into smaller steps any more. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_fbdev.c | 3

[PATCH 04/14] drm/bochs: atomic: add mode_set_nofb callback.

2018-12-19 Thread Gerd Hoffmann
Conversion to atomic modesetting, step two. Add mode_set_nofb crtc helper callback. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index

[PATCH 06/14] drm/bochs: atomic: use atomic set_config helper

2018-12-19 Thread Gerd Hoffmann
Conversion to atomic modesetting, step four. Use atomic set_config helper for crtc. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index

[PATCH 01/14] drm/bochs: encoder cleanup

2018-12-19 Thread Gerd Hoffmann
Most unused callbacks can be NULL pointers these days. Drop a bunch of empty encoder callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm

[PATCH 02/14] drm/bochs: split bochs_hw_setmode

2018-12-19 Thread Gerd Hoffmann
Create a separate bochs_hw_setformat function to configure the framebuffer format (actually just the byteorder). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 5 +++-- drivers/gpu/drm/bochs/bochs_hw.c | 19 --- drivers/gpu/drm/bochs/bochs_kms.c | 3

[PATCH] drm/bochs: add edid present check

2018-12-19 Thread Gerd Hoffmann
Check first two header bytes before trying to read the edid blob, to avoid the log being spammed in case qemu has no edid support (old qemu or edid turned off). Fixes: 01f23459cf drm/bochs: add edid support. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 4 1 file

[PATCH 03/14] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks.

2018-12-19 Thread Gerd Hoffmann
Conversion to atomic modesetting, step one. Add atomic crtc helper callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c

[PATCH] drm/virtio: switch to generic fbdev emulation

2018-12-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 14 --- drivers/gpu/drm/virtio/virtgpu_display.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.c | 9 +- drivers/gpu/drm/virtio/virtgpu_fb.c | 191 --- drivers/gpu/drm/virtio

[PATCH v2 17/18] drm/qxl: use generic fbdev emulation

2018-12-14 Thread Gerd Hoffmann
Switch qxl over to the new generic fbdev emulation. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 7 --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl

[PATCH v2 15/18] drm/qxl: use qxl_num_crtc directly

2018-12-14 Thread Gerd Hoffmann
d when reading the code you don't have to trace where and why qdev->monitors_config->max_allowed is set. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_

[PATCH v2 01/18] drm/qxl: drop ttm_mem_reg arg from qxl_hw_surface_alloc()

2018-12-14 Thread Gerd Hoffmann
Not used, is always NULL. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 3 +-- drivers/gpu/drm/qxl/qxl_cmd.c| 14 ++ drivers/gpu/drm/qxl/qxl_object.c | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b

[PATCH v2 04/18] drm/qxl: change the way slot is detected

2018-12-13 Thread Gerd Hoffmann
From: Frediano Ziglio Instead of relaying on surface type use the actual placement. This allow to have different placement for a single type of surface. Signed-off-by: Frediano Ziglio [ kraxel: rebased, adapted to upstream changes ] Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl

[PATCH v2 13/18] drm/qxl: use shadow bo directly

2018-12-13 Thread Gerd Hoffmann
ing and the workflow in qxl_primary_atomic_update(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_cmd.c | 8 +++- drivers/gpu/drm/qxl/qxl_display.c | 33 +++-- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_cmd.

[PATCH v2 02/18] drm/qxl: drop unused qxl_fb_virtual_address

2018-12-13 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 38c5a8b1df..7eabf4a9ed 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h

[PATCH v2 18/18] drm/qxl: remove dead qxl fbdev emulation code

2018-12-13 Thread Gerd Hoffmann
Lovely diffstat, thanks to the new generic fbdev emulation. drm/qxl/Makefile |2 drm/qxl/qxl_draw.c | 232 drm/qxl/qxl_drv.h | 21 --- drm/qxl/qxl_fb.c | 300 - Signed-off-by: Gerd Hoffmann

[PATCH v2 14/18] drm/qxl: cover all crtcs in shadow bo.

2018-12-13 Thread Gerd Hoffmann
ry surface), make it big enough that dumb bo's for all crtcs fit in side-by-side. Adjust the pageflip blits to place the heads next to each other in the shadow. With this patch in place multihead qxl works with wayland. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 5 +- d

[PATCH v2 16/18] drm/qxl: implement prime kmap/kunmap

2018-12-13 Thread Gerd Hoffmann
Generic fbdev emulation needs this. Also: We must keep track of the number of mappings now, so we don't unmap early in case two users want a kmap of the same bo. Add a sanity check to destroy callback to make sure kmap/kunmap is balanced. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl

[PATCH v2 12/18] drm/qxl: track primary bo

2018-12-13 Thread Gerd Hoffmann
Track which bo is used as primary surface. With that in place we don't need the primary_created flag any more, we can just check the primary bo pointer instead. Also verify we don't already have a primary surface in qxl_io_create_primary(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl

[PATCH v2 11/18] drm/qxl: drop unused offset parameter from qxl_io_create_primary()

2018-12-13 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 1 - drivers/gpu/drm/qxl/qxl_cmd.c | 7 +++ drivers/gpu/drm/qxl/qxl_display.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index

[PATCH v2 10/18] drm/qxl: move qxl_primary_apply_cursor to correct place

2018-12-13 Thread Gerd Hoffmann
The cursor must be set again after creating the primary surface. Also drop the error message. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm

[PATCH v2 08/18] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for shadow bo.

2018-12-13 Thread Gerd Hoffmann
The shadow bo is used as qxl surface, so allocate it as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 09/18] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for dumb gem objects

2018-12-13 Thread Gerd Hoffmann
dumb buffers are used as qxl surfaces, so allocate them as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 07/18] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE

2018-12-13 Thread Gerd Hoffmann
qxl surfaces (used for framebuffers and gem objects) can live in both VRAM and PRIV ttm domains. Update placement setup to include both. Put PRIV first in the list so it is preferred, so VRAM will have more room for objects which must be allocated there. Signed-off-by: Gerd Hoffmann

[PATCH v2 06/18] drm/qxl: use separate offset spaces for the two slots / ttm memory types.

2018-12-13 Thread Gerd Hoffmann
Without that ttm offsets are not unique, they can refer to objects in both VRAM and PRIV memory (aka main and surfaces slot). One of those "why things didn't blow up without this" moments. Probably offset conflicts are rare enough by pure luck. Signed-off-by: Gerd Hoffmann --- drive

[PATCH v2 05/18] drm/qxl: drop unused fields from struct qxl_device

2018-12-13 Thread Gerd Hoffmann
slot_id_bits and slot_gen_bits can be read directly from qxlrom instead. va_slot_mask is never used anywhere. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 3 --- drivers/gpu/drm/qxl/qxl_kms.c | 10 ++ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git

[PATCH v2 03/18] drm/qxl: simplify slot management

2018-12-13 Thread Gerd Hoffmann
Drop pointless indirection, remove the mem_slots array and index variables, drop dynamic allocation. Store memslots in qxl_device instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 15 + drivers/gpu/drm/qxl/qxl_kms.c | 72

<    3   4   5   6   7   8   9   10   11   12   >