[PATCH V4 1/7] weston: Add weston randr protocol

Quanxian Wang quanxian.wang at intel.com
Thu Apr 24 00:50:05 PDT 2014


Weston randr protocol will provide interfaces to
1) Scaling
   Scale the output to be more than 1.
2) Transform
   Rotate output to be 8 type of angles.
   0, 90, 180, 270, flip-0, flip-90, flip-180, flip-270
3) Mode Set
   Fuzzy set: First matched, first active.
   Exact set:
      a) Exact Timing set
      b) Exact mode number set (select the nth mode from mode list)
4) New a mode of output
   a) newmode for RDP
      RDP developers should add additional newmode backend interface for that.
   b) newtiming for drm backend
5) Delete a mode of output
   All matched, all deleted.
   Fuzzy and exact match are supported as described above
6) Re-position of output
   Primary, auto, leftof, rightof, above, below are supported.
   Primary: let output to the top left most output (x=0, y=0).
   Auto: re-organize all outputs to be horizontal with extended mode.
   leftof: left of relative output. So rightof, above, and below.
7) Support configure file
   Client could put all configure request in one file with
   defined format and submit it from randr interface.
8) Provide a set of actions above in one commit
9) Support multiple outputs operations with one commit.

This protocol is not exposed to public. It is only for
QA testing and Admin configuration currently.

Signed-off-by: Quanxian Wang <quanxian.wang at intel.com>
---
 protocol/Makefile.am |   1 +
 protocol/randr.xml   | 316 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 317 insertions(+)
 create mode 100644 protocol/randr.xml

diff --git a/protocol/Makefile.am b/protocol/Makefile.am
index 5e331a7..df2e070 100644
--- a/protocol/Makefile.am
+++ b/protocol/Makefile.am
@@ -5,6 +5,7 @@ protocol_sources =				\
 	text.xml				\
 	input-method.xml			\
 	workspaces.xml				\
+	randr.xml				\
 	text-cursor-position.xml		\
 	wayland-test.xml			\
 	xdg-shell.xml				\
diff --git a/protocol/randr.xml b/protocol/randr.xml
new file mode 100644
index 0000000..e6476f5
--- /dev/null
+++ b/protocol/randr.xml
@@ -0,0 +1,316 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="randr">
+
+  <copyright>
+    Copyright © 2014 Quanxian Wang
+    Copyright © 2014 Intel Corporation
+
+    Permission to use, copy, modify, distribute, and sell this
+    software and its documentation for any purpose is hereby granted
+    without fee, provided that the above copyright notice appear in
+    all copies and that both that copyright notice and this permission
+    notice appear in supporting documentation, and that the name of
+    the copyright holders not be used in advertising or publicity
+    pertaining to distribution of the software without specific,
+    written prior permission.  The copyright holders make no
+    representations about the suitability of this software for any
+    purpose.  It is provided "as is" without express or implied
+    warranty.
+
+    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+    THIS SOFTWARE.
+  </copyright>
+
+  <interface name="wrandr_type" version="1">
+    <description summary="Weston randr data type">
+      This interface contains all data types used by weston randr protocol.
+    </description>
+
+    <enum name="wop">
+      <description summary="Compositor operation type">
+	Weston operation type
+      </description>
+      <entry name="configure" value="1"/>
+      <entry name="auto" value="2"/>
+    </enum>
+
+    <enum name="oop">
+      <description summary="Output operation type">
+	Output operation type
+      </description>
+      <entry name="modenum" value="0"/>
+      <entry name="mode" value="1"/>
+      <entry name="timing" value="2"/>
+      <entry name="movel"  value="3" summary="move left"/>
+      <entry name="mover"  value="4" summary="move right"/>
+      <entry name="movea"  value="5" summary="move above"/>
+      <entry name="moveb"  value="6" summary="move below"/>
+      <entry name="transform" value="7"/>
+      <entry name="scale" value="8"/>
+      <entry name="newmode" value="9"/>
+      <entry name="newtiming" value="10"/>
+      <entry name="delmodenum" value="11"/>
+      <entry name="delmode" value="12"/>
+      <entry name="clone" value="13"/>
+      <entry name="primary" value="14"/>
+      <entry name="switch" value="15"/>
+    </enum>
+
+    <enum name="ret">
+      <description summary="Weston randr return value">
+	Weston randr operation return type
+      </description>
+      <entry name="SUCCESS" value="0"/>
+      <entry name="FAIL" value="1"/>
+      <entry name="NOACT" value="2"/>
+      <entry name="NOSUPP" value="3"/>
+    </enum>
+  </interface>
+
+  <interface name="weston_randr" version="1">
+    <description summary="Weston randr interface">
+	The weston randr interface provides output property setting
+	capabilities. The properties include output mode setting,
+	scale, transform, layout, and etc. The interface is not
+	exposed to public while it is designed for QA testing and Admin.
+	This interface refers to the design idea of xrandr protocol.
+    </description>
+
+    <request name="destroy" type="destructor">
+      <description summary="Unbind from the weston_randr interface">
+	Destroy the weston_randr object which will not be used anymore.
+      </description>
+    </request>
+
+    <enum name="mode">
+      <description summary="Mode flag">
+	The flag describes properties of an output mode.
+	Once clients get the mode change with these flags,
+	they should take the related action. For example,
+	del flag tells clients that mode is not used anymore.
+	Clients should delete it at once.
+      </description>
+      <entry name="custom" value="0x1000"
+	     summary="The mode is defined by client."/>
+      <entry name="del" value="0x2000"
+	     summary="The mode is deleted and not used any more."/>
+    </enum>
+
+    <request name="set_modenum">
+      <description summary="Set nth mode">
+	Set the nth mode
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="num" type="int"/>
+    </request>
+
+    <request name="set_mode">
+      <description summary="Set the mode of output">
+	Fuzzy output mode setting
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="refresh" type="int"/>
+    </request>
+
+    <request name="set_timing">
+      <description summary="Set timing of output">
+	Exact output mode setting
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="clock" type="uint"
+           summary="Pixel clock (kHz)"/>
+      <arg name="hdisplay" type="int"
+           summary="The number of pixel for one horticontal line"/>
+      <arg name="hsync_start" type="int"
+           summary="Start of horizontal sync signal"/>
+      <arg name="hsync_end" type="int"
+           summary="End of horizontal sync signal"/>
+      <arg name="htotal" type="int"
+           summary="The whole cycle of a horizontal line"/>
+      <arg name="vdisplay" type="int"
+           summary="The number of pixel for one vertical line"/>
+      <arg name="vsync_start" type="int"
+           summary="Start of vertical sync signal"/>
+      <arg name="vsync_end" type="int"
+           summary="End of vertical sync signal"/>
+      <arg name="vtotal" type="int"
+           summary="The whole cycle of a vertical"/>
+      <arg name="vscan" type="int"
+           summary="The number of times each scanline is painted"/>
+      <arg name="flags" type="int" summary="Mode flags"/>
+    </request>
+
+    <request name="set_transform">
+      <description summary="Set output transform">
+	Set output transform and the values should
+	be 0-7. They means 0, 90, 180, 270, FLIP-0, FLIP-90,
+	FLIP-180, FLIP-270. These terms are from
+	the wl_output protocol.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="transform" type="uint"
+           summary="The value should be between 0-7."/>
+    </request>
+
+    <request name="set_scale">
+      <description summary="Set output scale">
+	Scale output.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="scale" type="int"/>
+    </request>
+
+    <request name="move">
+      <description summary="Move target output">
+	Position output relative to target output.
+      </description>
+      <arg name="target_output" type="object" interface="wl_output"
+           summary="the target output object"/>
+      <arg name="source_output" type="object" interface="wl_output"
+           summary="the source output object"/>
+      <arg name="move" type="int"/>
+    </request>
+
+    <request name="delmodenum">
+      <description summary="Delete the nth mode of output">
+	Delete the nth mode of output.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="num" type="int"/>
+    </request>
+
+    <request name="delmode">
+      <description summary="Delete the mode of output">
+	Fuzzy deletion of output mode.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="refresh" type="int"/>
+    </request>
+
+    <request name="newmode">
+      <description summary="New the mode of output">
+	Custom a simple output mode.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="refresh" type="int"/>
+    </request>
+
+    <request name="newtiming">
+      <description summary="Custom new mode">
+	Custom a new output mode.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="clock" type="uint"
+           summary="Pixel clock (kHz)"/>
+      <arg name="hdisplay" type="int"
+           summary="The number of pixel for one horticontal line"/>
+      <arg name="hsync_start" type="int"
+           summary="Start of horizontal sync signal"/>
+      <arg name="hsync_end" type="int"
+           summary="End of horizontal sync signal"/>
+      <arg name="htotal" type="int"
+           summary="The whole cycle of a horizontal line"/>
+      <arg name="vdisplay" type="int"
+           summary="The number of pixel for one vertical line"/>
+      <arg name="vsync_start" type="int"
+           summary="Start of vertical sync signal"/>
+      <arg name="vsync_end" type="int"
+           summary="End of vertical sync signal"/>
+      <arg name="vtotal" type="int"
+           summary="The whole cycle of a vertical"/>
+      <arg name="vscan" type="int"
+           summary="The number of times each scanline is painted"/>
+      <arg name="flags" type="int" summary="Mode flags"/>
+    </request>
+
+    <request name="configure">
+      <description summary="Submit a configure file">
+	Submit a configure file to randr interface for parsing.
+	The file contains more configure request set.
+      </description>
+      <arg name="configure" type="string"
+           summary="Sumbit config file which contains configure requests."/>
+    </request>
+
+    <request name="clone">
+      <description summary="clone target output">
+	Clone target output
+      </description>
+      <arg name="target_output" type="object" interface="wl_output"
+           summary="the target output object"/>
+      <arg name="source_output" type="object" interface="wl_output"
+           summary="the source output object"/>
+    </request>
+
+    <request name="auto_layout">
+      <description summary="Auto layout all outputs">
+	Automatically layout all outputs horizontal with extended mode.
+      </description>
+    </request>
+
+    <request name="primary">
+      <description summary="Set output as primary">
+	Primary output is the top left output(x=0, y=0).
+      </description>
+      <arg name="output" type="object" interface="wl_output"/>
+    </request>
+
+    <request name="switch_output">
+      <description summary="Switch output on/off">
+	Switch output to be active or inactive.
+      </description>
+      <arg name="output" type="object" interface="wl_output"/>
+      <arg name="on" type="int"/>
+    </request>
+
+    <request name="commit">
+      <description summary="Multiple operations on one output">
+	Commit all the previous output requests from the client.
+	Before the commit, change requests will be stored in randr interface.
+	Once client commits, all pending changes of the client will be submit.
+      </description>
+      <arg name="callback" type="new_id" interface="wrandr_callback"/>
+    </request>
+  </interface>
+
+  <interface name="wrandr_callback" version="1">
+    <description summary="Weston randr callback interface">
+	It is a callback interface which can notify randr client
+	after commit.
+    </description>
+
+    <event name="done">
+      <description summary="Operation done event">
+	Notify the randr client when randr commits.
+	Flags contain all the operations executed. Every bit stands for one
+	type of operation. In result, every 2 bit contains the results of
+	every operation including FAIL, SUCCESS, NOT ACTION, NOT SUPPORTED.
+      </description>
+      <arg name="output" type="object" interface="wl_output" allow-null="true"/>
+      <arg name="flags" type="uint" summary="Operation flags"/>
+      <arg name="result1" type="uint" summary="1st 32bit"/>
+      <arg name="result2" type="uint" summary="2nd 32bit"/>
+    </event>
+  </interface>
+</protocol>
-- 
1.8.1.2



More information about the wayland-devel mailing list