Skip to contentSkip to conversation

sna/video sprite patch: support for multiple xv ports

PATCH In review Michael Hadley 2 participants 2 messages Mar 31, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 sna/video sprite patch: support for multiple xv ports

The current driver exposes only a single adaptor port so that only one xv video can be played on sprite at a time. This change will allow available hardware sprites to be used.

v4: re-formatted code, renamed sprite_disable_unlock() to sprite_unlock()
to be clearer. Also moved the sprite locking mechanism from sprite_disable() to sna_crtc_sprite_unlock(), seperating the logic between both functions and isolating them to their specific purposes.

v3: updated patch from [email protected]. removed/added
whitespace, re-formatted code, removed redundent variable allocation.

v2: removed/added whitespace, check for NULL return from calloc
made requested changes to simplify code (not exactly as requested due to struct sprite being 'private' to sna_display.c).

---
 src/sna/sna.h                |   7 +-
 src/sna/sna_display.c        | 201 ++++++++++++++++++++++++++++++++++++-------
 src/sna/sna_video.h          |   2 +
 src/sna/sna_video_sprite.c   | 146 ++++++++++++++++++-------------
 src/sna/sna_video_textured.c |   2 +-
 5 files changed, 260 insertions(+), 98 deletions(-)
src/sna/sna.h +5 -2
index e5ca906..0fce602 100644
@@ -608,8 +608,11 @@ static inline void sna_present_vblank_handler(struct drm_event_vblank *event) {
 static inline void sna_present_cancel_flip(struct sna *sna) { }
 #endif
 
-extern bool sna_crtc_set_sprite_rotation(xf86CrtcPtr crtc, uint32_t rotation);
-extern uint32_t sna_crtc_to_sprite(xf86CrtcPtr crtc);
+extern bool sna_crtc_set_sprite_rotation(xf86CrtcPtr crtc, uint32_t rotation, DrawablePtr draw);
+extern uint32_t sna_crtc_num_sprites(xf86CrtcPtr crtc);
+extern bool sna_crtc_drawable_to_sprite_id(xf86CrtcPtr crtc, DrawablePtr draw, uint32_t *id);
+extern bool sna_crtc_sprite_lock(xf86CrtcPtr crtc, DrawablePtr draw);
+extern void sna_crtc_sprite_unlock(xf86CrtcPtr crtc, DrawablePtr draw);
 extern bool sna_crtc_is_transformed(xf86CrtcPtr crtc);
 
 #define CRTC_VBLANK 0x3
src/sna/sna_display.c +168 -33

309 lines not on this page · raw message

src/sna/sna_video.h +2 -0
index b278991..24ce4fc 100644
@@ -133,6 +133,8 @@ void sna_video_textured_setup(struct sna *sna, ScreenPtr screen);
 void sna_video_destroy_window(WindowPtr win);
 void sna_video_close(struct sna *sna);
 
+int sna_video_textured_put_image(ddPutImage_ARGS);
+
 XvAdaptorPtr sna_xv_adaptor_alloc(struct sna *sna);
 int sna_xv_fixup_formats(ScreenPtr screen,
 			 XvFormatPtr formats,
src/sna/sna_video_sprite.c +84 -62

231 lines not on this page · raw message

src/sna/sna_video_textured.c +1 -1
index f5b7e98..baf7c91 100644
@@ -138,7 +138,7 @@ sna_video_textured_best_size(ddQueryBestSize_ARGS)
  * drawable is some Drawable, which might not be the screen in the case of
  * compositing.  It's a new argument to the function in the 1.1 server.
  */
-static int
+int
 sna_video_textured_put_image(ddPutImage_ARGS)
 {
 	struct sna_video *video = port->devPriv.ptr;
Signature · 6 lines
1.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 3 lines · Michael Hadley

The current driver exposes only a single adaptor port so that only one xv video can be played on sprite at a time. This change will allow available hardware sprites to be used.

It's a bad change in semantics as you no longer guarrantee that you give the client the overlay plane they requested with the same set of compatible attributes.

This code will not compile on older Xorg, and you have also randomly broken other features not related to Xv.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx