[PATCH] glamor: spans: fixup wrong count on glDrawArrays

2016-10-01 Thread Mark Yao
since commit (9e9fcf5 glamor: Add a helper function for the common
GL_QUADS fallback pattern.), the glDrawArrays count change to nbox,
That is wrong, I think it maybe cause by fat finger.

Signed-off-by: Mark Yao 
---
 glamor/glamor_spans.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/glamor/glamor_spans.c b/glamor/glamor_spans.c
index 8ed29a4..4280c14 100644
--- a/glamor/glamor_spans.c
+++ b/glamor/glamor_spans.c
@@ -134,7 +134,7 @@ glamor_fill_spans_gl(DrawablePtr drawable,
 if (glamor_priv->glsl_version >= 130)
 glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, n);
 else {
-glamor_glDrawArrays_GL_QUADS(glamor_priv, nbox);
+glamor_glDrawArrays_GL_QUADS(glamor_priv, n);
 }
 }
 }
-- 
1.9.1


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] remove dead code in dummy driver

2016-10-01 Thread Bob Terek


On 09/27/2016 12:22 AM, Antoine Martin wrote:


It think it probably makes sense to apply the cleanup patches first, to
remove code before adding some more?


I had planned to send them all at once, but you're right, it is a good 
idea to get the cleanups in separately.


My problem has been that my day job has been getting in the way so far, 
and now I'm leaving for a 3 week vacation in a few hours. I'd be happy 
to address the cleanups around the 24th, if that is ok, and my proposed 
change shortly thereafter. I'm sure Aaron has better things to do than 
deal with dummy.


Cheers,

Bob Terek
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 1/3] xfree86: Immediately handle failure to set HW cursor, v5

2016-10-01 Thread Hans de Goede

Hi,

On 30-09-16 17:55, Michael Thayer wrote:

Based on v4 by Alexandre Courbot 

There is currently no reliable way to report failure to set a HW
cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM
ioctl fails (which currently happens at least with modesetting on Tegra
for format incompatibility reasons).

As failures are currently handled by setting the HW cursor size to
(0,0), the fallback to SW cursor will not happen until the next time the
cursor changes and xf86CursorSetCursor() is called again. In the
meantime, the cursor will be invisible to the user.

This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and
_xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans.
This allows to propagate errors up to xf86CursorSetCursor(), which can
then fall back to using the SW cursor immediately.

v5: Updated the patch to apply to current git HEAD, split up into two
patches (server and modesetting driver) and adjusted the code slightly
to match surrounding code.  I also removed the new exported function
ShowCursorCheck(), as instead just changing ShowCursor() to return Bool
should not affect its current callers.

Signed-off-by: Michael Thayer 


Series looks good to me and is:

Reviewed-by: Hans de Goede 

As discussed this will need to wait till we start the 1.20
cycle before it can be merged (it contains a video driver ABI change)

Regards,

Hans




---
 hw/xfree86/modes/xf86Crtc.h|  4 +++-
 hw/xfree86/modes/xf86Cursors.c | 40 ++--
 hw/xfree86/ramdac/xf86Cursor.h | 16 
 hw/xfree86/ramdac/xf86HWCurs.c |  8 
 4 files changed, 53 insertions(+), 15 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 14ba9d7..215eb2a 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -195,6 +195,8 @@ typedef struct _xf86CrtcFuncs {
  */
 void
  (*show_cursor) (xf86CrtcPtr crtc);
+Bool
+ (*show_cursor_check) (xf86CrtcPtr crtc);

 /**
  * Hide cursor
@@ -993,7 +995,7 @@ static _X_INLINE _X_DEPRECATED void 
xf86_reload_cursors(ScreenPtr screen) {}
 /**
  * Called from EnterVT to turn the cursors back on
  */
-extern _X_EXPORT void
+extern _X_EXPORT Bool
  xf86_show_cursors(ScrnInfoPtr scrn);

 /**
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 1bc2b27..9543eed 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -210,9 +210,15 @@ set_bit(CARD8 *image, xf86CursorInfoPtr cursor_info, int 
x, int y, Bool mask)

 /*
  * Wrappers to deal with API compatibility with drivers that don't expose
- * load_cursor_*_check
+ * *_cursor_*_check
  */
 static inline Bool
+xf86_driver_has_show_cursor(xf86CrtcPtr crtc)
+{
+return crtc->funcs->show_cursor_check || crtc->funcs->show_cursor;
+}
+
+static inline Bool
 xf86_driver_has_load_cursor_image(xf86CrtcPtr crtc)
 {
 return crtc->funcs->load_cursor_image_check || 
crtc->funcs->load_cursor_image;
@@ -225,6 +231,15 @@ xf86_driver_has_load_cursor_argb(xf86CrtcPtr crtc)
 }

 static inline Bool
+xf86_driver_show_cursor(xf86CrtcPtr crtc)
+{
+if (crtc->funcs->show_cursor_check)
+return crtc->funcs->show_cursor_check(crtc);
+crtc->funcs->show_cursor(crtc);
+return TRUE;
+}
+
+static inline Bool
 xf86_driver_load_cursor_image(xf86CrtcPtr crtc, CARD8 *cursor_image)
 {
 if (crtc->funcs->load_cursor_image_check)
@@ -333,16 +348,19 @@ xf86_hide_cursors(ScrnInfoPtr scrn)
 }
 }

-static void
+static Bool
 xf86_crtc_show_cursor(xf86CrtcPtr crtc)
 {
-if (!crtc->cursor_shown && crtc->cursor_in_range) {
-crtc->funcs->show_cursor(crtc);
-crtc->cursor_shown = TRUE;
-}
+if (!crtc->cursor_in_range)
+return TRUE;
+
+if (!crtc->cursor_shown)
+crtc->cursor_shown = xf86_driver_show_cursor(crtc);
+
+return crtc->cursor_shown;
 }

-void
+Bool
 xf86_show_cursors(ScrnInfoPtr scrn)
 {
 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -352,9 +370,11 @@ xf86_show_cursors(ScrnInfoPtr scrn)
 for (c = 0; c < xf86_config->num_crtc; c++) {
 xf86CrtcPtr crtc = xf86_config->crtc[c];

-if (crtc->enabled)
-xf86_crtc_show_cursor(crtc);
+if (crtc->enabled && !xf86_crtc_show_cursor(crtc))
+return FALSE;
 }
+
+return TRUE;
 }

 static void
@@ -653,7 +673,7 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int 
max_height, int flags)
 cursor_info->SetCursorPosition = xf86_set_cursor_position;
 cursor_info->LoadCursorImageCheck = xf86_load_cursor_image;
 cursor_info->HideCursor = xf86_hide_cursors;
-cursor_info->ShowCursor = xf86_show_cursors;
+cursor_info->ShowCursorCheck = xf86_show_cursors;
 cursor_info->UseHWCursor = xf86_use_hw_cursor;
 if (flags & HARDWARE_CURSOR_ARGB) {
 cursor_info->UseHWCursorARGB =