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

2019-01-16 Thread Frediano Ziglio
> > Add a helper functions to check video modes. Also add a helper to check > framebuffer buffer objects, using the former for consistency. That way > we should not fail in qxl_primary_atomic_check() because video modes > which are too big will not be added to the mode list in the first place. >

Re: [Spice-devel] [PATCH 1/3] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE

2018-12-06 Thread Frediano Ziglio
> > On Thu, Dec 06, 2018 at 05:55:58AM -0500, Frediano Ziglio wrote: > > > > > 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 lis

Re: [Spice-devel] [PATCH] drm/qxl: use qxl_num_crtc directly

2018-12-06 Thread Frediano Ziglio
> > On Thu, Dec 06, 2018 at 07:53:10AM -0500, Frediano Ziglio wrote: > > > > > > On Thu, Dec 06, 2018 at 05:59:25AM -0500, Frediano Ziglio wrote: > > > > > > > > > > Just use qxl_num_crtc directly everywhere instead of using > >

Re: [Spice-devel] [PATCH] drm/qxl: use qxl_num_crtc directly

2018-12-06 Thread Frediano Ziglio
> > On Thu, Dec 06, 2018 at 05:59:25AM -0500, Frediano Ziglio wrote: > > > > > > Just use qxl_num_crtc directly everywhere instead of using > > > qdev->monitors_config->max_allowed. Drops pointless indirection > > > and also is less confusi

[PATCH 01/11] drm/qxl: Do not cause spice-server to clean our objects

2015-06-03 Thread Frediano Ziglio
If objects are moved back from system memory to VRAM (and spice id created again) memory is already initialized so we need to set flag to not clear memory. If you don't do it after a while using desktop many images turns to black or transparents. Signed-off-by: Frediano Ziglio Reviewed-by:

[PATCH 02/11] drm/qxl: Do not leak memory if qxl_release_list_add fails

2015-06-03 Thread Frediano Ziglio
If the function fails reference counter to the object is not decremented causing leaks. This is hard to spot as it happens only on very low memory situations. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ioctl.c | 4 +++- 1 file changed, 3 insertions

[PATCH 08/11] drm/qxl: Remove format string errors

2015-06-03 Thread Frediano Ziglio
Enable format string checks for qxl_io_log and remove resulting warnings which could lead to memory errors on different platform or just printing wrong information. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl

[PATCH 05/11] drm/qxl: Handle all errors in qxl_surface_evict

2015-06-03 Thread Frediano Ziglio
Only EBUSY error was handled. This could cause code to believe reserve was successful while it failed. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_cmd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/qxl

[PATCH 06/11] drm/qxl: Fix return for qxl_release_alloc

2015-06-03 Thread Frediano Ziglio
This function return handle to allocated release object which is an int. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_release.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl

[PATCH 04/11] drm/qxl: Avoid double free on error

2015-06-03 Thread Frediano Ziglio
Is we are not able to get source bo object from handle we free destination bo object and call cleanup code however destination object was already inserted in reloc_info array (num_relocs was already incremented) so on cleanup we free destination again. Signed-off-by: Frediano Ziglio Reviewed-by

[PATCH 07/11] drm/qxl: Handle correctly failures in qxl_alloc_relase_reserved

2015-06-03 Thread Frediano Ziglio
Free resources correctly if function fails Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_release.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index

[PATCH 10/11] drm/qxl: Simplify cleaning qxl processing command

2015-06-03 Thread Frediano Ziglio
In qxlhw_handle_to_bo we incremented counters twice, one time for release object and one for reloc_info. In the main function however reloc_info references was drop much earlier than release so keeping the pointer only on release is safe and make cleaning process easier. Signed-off-by: Frediano

[PATCH 09/11] drm/qxl: Move main reference counter to GEM object instead of TTM ones

2015-06-03 Thread Frediano Ziglio
moving main counter (the one used by qxl_bo_(un)ref) to GEM object which cleanup routine (qxl_gem_object_free) remove the idr pointer (using qxl_surface_evict) when the counters are still valid. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_gem.c| 10

[PATCH 11/11] drm/qxl: Propagate correctly errors from qxlhw_handle_to_bo

2015-06-03 Thread Frediano Ziglio
assuming EINVAL. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ioctl.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index bb326ff

[PATCH 03/11] drm/qxl: Fix print statement not using uninitialized variable

2015-06-03 Thread Frediano Ziglio
reloc_info[i] is not still initialized in the print statement. Signed-off-by: Frediano Ziglio Reviewed-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index

[PATCH 00/11 v2] Miscellaneous stability patches

2015-06-03 Thread Frediano Ziglio
errors" should just print garbage and debugging is disabled by default, not necessary. Frediano Ziglio (11): drm/qxl: Do not cause spice-server to clean our objects drm/qxl: Do not leak memory if qxl_release_list_add fails drm/qxl: Fix print statement not using uninitialize

Re: [Spice-devel] [PATCH 09/11] Move main reference counter to GEM object instead of TTM ones

2015-05-29 Thread Frediano Ziglio
> On 27 May 2015 at 20:04, Frediano Ziglio wrote: > > qxl_bo structure has two reference counters, one in the GEM object and > > another in the TTM object. The GEM object keep a counter to the TTM object > > so when GEM counter reached zero the TTM counter (us

Re: [Spice-devel] [PATCH 00/11] Miscellaneous stability patches

2015-05-28 Thread Frediano Ziglio
> > > I was using a different repository with only QXL driver. I tested and all > > patches apply and compile perfectly even with Linus master branch. > > Lets only post patches people can apply, it makes it harder to figure > out stuff. I'll take a look at the patches, but it would be good to >

Re: [PATCH 00/11] Miscellaneous stability patches

2015-05-27 Thread Frediano Ziglio
> > On Wed, May 27, 2015 at 8:47 AM, Josh Boyer > wrote: > > On Wed, May 27, 2015 at 6:03 AM, Frediano Ziglio > > wrote: > >> This set of patches mainly contains fix for some memory issues > >> using quite aggressively surfaces and other minor problems lik

[PATCH 02/11] Do not leak memory if qxl_release_list_add fails

2015-05-27 Thread Frediano Ziglio
If the function fails reference counter to the object is not decremented causing leaks. This is hard to spot as it happens only on very low memory situations. Signed-off-by: Frediano Ziglio --- qxl/qxl_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qxl

[PATCH 00/11] Miscellaneous stability patches

2015-05-27 Thread Frediano Ziglio
This set of patches mainly contains fix for some memory issues using quite aggressively surfaces and other minor problems like images going black after a while. Frediano Ziglio (11): Do not cause spice-server to clean our objects Do not leak memory if qxl_release_list_add fails Fix print

[PATCH 03/11] Fix print statement not using uninitialized variable

2015-05-27 Thread Frediano Ziglio
reloc_info[i] is not still initialized in the print statement. Signed-off-by: Frediano Ziglio --- qxl/qxl_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qxl/qxl_ioctl.c b/qxl/qxl_ioctl.c index e8b5207..230ab84 100644 --- a/qxl/qxl_ioctl.c +++ b/qxl/qxl_ioctl.c

[PATCH 06/11] Fix return for qxl_release_alloc

2015-05-27 Thread Frediano Ziglio
This function return handle to allocated release object which is an int. Signed-off-by: Frediano Ziglio --- qxl/qxl_release.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qxl/qxl_release.c b/qxl/qxl_release.c index d9b2568..6fd8e50 100644 --- a/qxl/qxl_release.c +++ b/qxl

[PATCH 04/11] Avoid double free on error

2015-05-27 Thread Frediano Ziglio
Is we are not able to get source bo object from handle we free destination bo object and call cleanup code however destination object was already inserted in reloc_info array (num_relocs was already incremented) so on cleanup we free destination again. Signed-off-by: Frediano Ziglio --- qxl

[PATCH 05/11] Handle all errors in qxl_surface_evict

2015-05-27 Thread Frediano Ziglio
Only EBUSY error was handled. This could cause code to believe reserve was successful while it failed. Signed-off-by: Frediano Ziglio --- qxl/qxl_cmd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qxl/qxl_cmd.c b/qxl/qxl_cmd.c index 85ed5dc..b18f84c 100644 --- a

[PATCH 01/11] Do not cause spice-server to clean our objects

2015-05-27 Thread Frediano Ziglio
If objects are moved back from system memory to VRAM (and spice id created again) memory is already initialized so we need to set flag to not clear memory. If you don't do it after a while using desktop many images turns to black or transparents. Signed-off-by: Frediano Ziglio --- qxl/qxl_

[PATCH 07/11] Handle correctly failures in qxl_alloc_relase_reserved

2015-05-27 Thread Frediano Ziglio
Free resources correctly if function fails Signed-off-by: Frediano Ziglio --- qxl/qxl_release.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qxl/qxl_release.c b/qxl/qxl_release.c index 6fd8e50..00604ed 100644 --- a/qxl/qxl_release.c +++ b/qxl/qxl_release.c

[PATCH 11/11] Propagate correctly errors from qxlhw_handle_to_bo

2015-05-27 Thread Frediano Ziglio
assuming EINVAL. Signed-off-by: Frediano Ziglio --- qxl/qxl_ioctl.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/qxl/qxl_ioctl.c b/qxl/qxl_ioctl.c index bb326ff..37f1faf 100644 --- a/qxl/qxl_ioctl.c +++ b/qxl/qxl_ioctl.c @@ -107,9 +107,9

[PATCH 08/11] Remove format string errors

2015-05-27 Thread Frediano Ziglio
Enable format string checks for qxl_io_log and remove resulting warnings which could lead to memory errors on different platform or just printing wrong information. Signed-off-by: Frediano Ziglio --- qxl/qxl_cmd.c | 2 +- qxl/qxl_display.c | 2 +- qxl/qxl_drv.h | 2 +- qxl/qxl_release.c

[PATCH 10/11] Simplify cleaning qxl processing command

2015-05-27 Thread Frediano Ziglio
In qxlhw_handle_to_bo we incremented counters twice, one time for release object and one for reloc_info. In the main function however reloc_info references was drop much earlier than release so keeping the pointer only on release is safe and make cleaning process easier. Signed-off-by: Frediano

[PATCH 09/11] Move main reference counter to GEM object instead of TTM ones

2015-05-27 Thread Frediano Ziglio
moving main counter (the one used by qxl_bo_(un)ref) to GEM object which cleanup routine (qxl_gem_object_free) remove the idr pointer (using qxl_surface_evict) when the counters are still valid. Signed-off-by: Frediano Ziglio --- qxl/qxl_gem.c| 10 -- qxl/qxl_object.c | 11 --- 2

Re: [Spice-devel] [PATCH] Do not loop on ERESTARTSYS using interruptible waits

2015-05-22 Thread Frediano Ziglio
> > Hey, > > On Tue, May 19, 2015 at 05:54:54AM -0400, Frediano Ziglio wrote: > > This problem happens using KMS surfaces and QXL driver. > > To easy reproduce use KDE Plasma (which use surfaces a lot) and assure > > you are using KMS surfaces (QXL driver o

[PATCH] Do not loop on ERESTARTSYS using interruptible waits

2015-05-19 Thread Frediano Ziglio
CPU usage on Qemu side too. Signed-off-by: Frediano Ziglio --- qxl/qxl_cmd.c | 12 +++- qxl/qxl_drv.h | 2 +- qxl/qxl_ioctl.c | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drivers/gpu/drm/qxl/qxl_cmd.c b/qxl/qxl_cmd.c index 9782364..bd5404e

RE: [Xen-devel] [PATCH] xen/arm: Return correct code error for xen_swiotlb_map_page

2014-11-10 Thread Frediano Ziglio
> On Thu, Nov 06, 2014 at 07:14:51PM +, Stefano Stabellini wrote: > > On Thu, 6 Nov 2014, Frediano Ziglio wrote: > > > 2014-11-06 17:30 GMT+00:00 Stefano Stabellini > : > > > On Thu, 6 Nov 2014, Frediano Ziglio wrote: > > > > On ARM er

RE: [Xen-devel] [PATCH] xen/arm: Return correct code error for xen_swiotlb_map_page

2014-11-07 Thread Frediano Ziglio
> On Thu, 6 Nov 2014, Frediano Ziglio wrote: > > 2014-11-06 17:30 GMT+00:00 Stefano Stabellini > : > > On Thu, 6 Nov 2014, Frediano Ziglio wrote: > > > On ARM error code is not 0 so avoid to return it as error. > > > > > > Signed

[PATCH] xen/arm: Return correct code error for xen_swiotlb_map_page

2014-11-06 Thread Frediano Ziglio
On ARM error code is not 0 so avoid to return it as error. Signed-off-by: Frediano Ziglio --- drivers/xen/swiotlb-xen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index ebd8f21..3b8d628 100644 --- a/drivers/xen

Re: [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain

2014-08-06 Thread Frediano Ziglio
On Tue, 2014-08-05 at 14:45 +0100, David Vrabel wrote: > On 05/08/14 14:42, Konrad Rzeszutek Wilk wrote: > > > > - Some of these hypercalls don't have an ABI so we can't depend > >on them being stable. How do you want to handle that? > > We are not going any further with this series because

Re: [Xen-devel] [PATCH 1/2] xen: Implement ioctl to restrict privcmd to a specific domain

2014-08-01 Thread Frediano Ziglio
On Fri, 2014-08-01 at 09:27 +0100, Jan Beulich wrote: > >>> On 31.07.14 at 15:16, wrote: > > Add a RESTRICT ioctl to /dev/xen/privcmd, which allows privileged commands > > file descriptor to be restricted to only working with a particular domain. > > The "with" here has been quite confusing, and

Re: [Xen-devel] xen: Fix possible page fault in fifo events

2014-07-15 Thread Frediano Ziglio
On Tue, 2014-07-15 at 15:32 +0100, Andrew Cooper wrote: > On 15/07/14 14:48, Frediano Ziglio wrote: > > sync_test_bit function require a long* read access to pointer. > > This is a problem if the you are using last entry in the page causing > > an access to next page. If this

xen: Fix possible page fault in fifo events

2014-07-15 Thread Frediano Ziglio
. For processors different than x64 long aligned operations are used. Signed-off-by: Frediano Ziglio --- drivers/xen/events/events_fifo.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c index d302639

xen: Remove useless cast

2014-07-15 Thread Frediano Ziglio
BM macro just do a cast to long*. This cast was required to avoid a warning as ready was unsigned int instead of long. As now the variable is already a long the cast is not needed. Signed-off-by: Frediano Ziglio --- drivers/xen/events/events_fifo.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2] xen: Fix possible user space selector corruption

2013-10-07 Thread Frediano Ziglio
code commit 7076aada1040de4ed79a5977dbabdb5e5ea5e249 appears to be the first one that have this issue. Signed-off-by: Frediano Ziglio --- arch/x86/xen/smp.c |9 + 1 file changed, 9 insertions(+) Just changed comment on source code as suggested by Andrew Cooper. diff --git a/arch

Re: [Xen-devel] [PATCH] xen: Fix possible user space selector corruption

2013-10-03 Thread Frediano Ziglio
On Thu, 2013-10-03 at 11:04 +0100, Andrew Cooper wrote: > On 03/10/13 09:24, Frediano Ziglio wrote: > > Due to the way kernel is initialized under Xen is possible that the ring1 > > selector used by the kernel for the boot cpu end up to be copied to > > userspace leading to

[PATCH] xen: Fix possible user space selector corruption

2013-10-03 Thread Frediano Ziglio
code commit 7076aada1040de4ed79a5977dbabdb5e5ea5e249 appears to be the first one that have this issue. Signed-off-by: Frediano Ziglio --- arch/x86/xen/smp.c | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index d1e4777..2a47241 100644

Re: [PATCH 11/93] xen: Fix stack corruption in xen_failsafe_callback for 32bit PVOPS guests.

2013-02-06 Thread Frediano Ziglio
At stated before I'm the author of this patch. Please change the From: to From: Frediano Ziglio Frediano On Tue, 2013-02-05 at 20:06 -0200, Herton Ronaldo Krzesinski wrote: > 3.5.7.5 -stable review patch. If anyone has any objections, please let me > know. > > ---

Re: [PATCH v2] Convert properly UTF-8 to UTF-16

2012-10-08 Thread Frediano Ziglio
> utf8 > Do you have some framework/hook to put these tests ? Where did you merge ? I cannot find nothing at http://gitweb.samba.org/?p=sfrench/cifs-2.6.git;a=summary Regards Frediano > On Wed, Oct 3, 2012 at 9:34 AM, Frediano Ziglio > wrote: > > On Tue, 2012-08-07 at 06:47 -0

Re: [PATCH v2] Convert properly UTF-8 to UTF-16

2012-10-03 Thread Frediano Ziglio
On Tue, 2012-08-07 at 06:47 -0400, Jeff Layton wrote: > On Tue, 7 Aug 2012 10:33:03 +0100 > Frediano Ziglio wrote: > > > > > wchar_t is currently 16bit so converting a utf8 encoded characters not > > in plane 0 (>= 0x1) to wchar_t (that is calling char2uni

Re: [PATCH v2] Convert properly UTF-8 to UTF-16

2012-08-28 Thread Frediano Ziglio
On Tue, 2012-08-07 at 06:47 -0400, Jeff Layton wrote: > On Tue, 7 Aug 2012 10:33:03 +0100 > Frediano Ziglio wrote: > > > > > wchar_t is currently 16bit so converting a utf8 encoded characters not > > in plane 0 (>= 0x1) to wchar_t (that is calling char2uni

[PATCH v2] Convert properly UTF-8 to UTF-16

2012-08-07 Thread Frediano Ziglio
wchar_t is currently 16bit so converting a utf8 encoded characters not in plane 0 (>= 0x1) to wchar_t (that is calling char2uni) lead to a -EINVAL return. This patch detect utf8 in cifs_strtoUTF16 and add special code calling utf8s_to_utf16s. Signed-off-by: Frediano Ziglio --- fs/c