<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Jason Ekstrand [mailto:jason@jlekstrand.net]
<br>
<b>Sent:</b> Thursday, February 27, 2014 11:29 AM<br>
<b>To:</b> Wang, Quanxian<br>
<b>Cc:</b> wayland-devel@lists.freedesktop.org; Zhang, Xiong Y<br>
<b>Subject:</b> Re: [PATCH 0/6] Add weston randr protocol<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Quanxian,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">I haven't looked through the code line-by-line, but I do have a few general comments.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">First, please double-check your copyright blocks.  One of your files is copyrighted Benjamin Franzke and another is copyrighted Collabora.  I don't think that was intended.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">[Wang, Quanxian] Aha, Sorry about that. I will update that. Some header are copied from others file. I will
 check that. Thanks for your reminder.</span></i></b><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Second, it doesn't appear that you have any security mechanism for this? 
<span style="color:#1F497D"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">I don't think we want arbitrary clients to be allowed to rotate, change mode, and change output layout. 
<span style="color:#1F497D"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">[Wang, Quanxian] The interface’s security is not controlled by protocol.  As a whole, I think if weston want
 to control that, it should have an independent security to control that or use the system control. For example, if you want to open the server display from client, we should add the permission denied for that.<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">While I agree that it would be great to have a tool (possibly even a command-line one) to do these things dynamically, we shouldn't make it a public interface that just anyone can bind to. 
 I'm not saying that some sort of randr interface isn't needed. I'm simply that it should be privileged and we need a well-defined mechanism for keeping rogue applications from messing up the compositor for everyone else.  For standard applications, I believe
 the intention is that any modesetting they do will be done in a very controlled manner through the shell.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">[Wang, Quanxian] Is there any plan for wayland/weston developer to add the security plan to control access?
 If there is some plan or interface, I can add it in the patches. Currently wayland/weston don’t provide a dynamic mode setting. It limited the dynamic action of applications above wayland/weston level. You know, we have to define it in weston config at the
 very beginning.<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Do you know anyone or program provide security control in weston code?<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><i><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">The objective of this patches provides a way how to do dynamic mode setting. It is really missed in wayland/weston.<o:p></o:p></span></i></b></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Thanks,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">--Jason Ekstrand<o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On Wed, Feb 26, 2014 at 9:27 PM, Quanxian Wang <<a href="mailto:quanxian.wang@intel.com" target="_blank">quanxian.wang@intel.com</a>> wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">These patches will provide weston randr protocol,<br>
its implementation and randr application.<br>
<br>
The idea is from xrandr provided by xserver. *Dynamic* mode<br>
setting is the main objective of this protocol. Remember,<br>
it is one shot operation. For example, if setting the mode,<br>
just call one request wl_randr_set_mode without any other operation.<br>
<br>
With this protocol, weston-wrandr application is developped to help<br>
user implement randr protocol in command line just like xrandr command<br>
in xserver.<br>
<br>
For wayland customer, this application could *DYNAMICALLY*<br>
do mode setting in command line.<br>
<br>
For wayland application developer, weston randr protocol provide<br>
a external interface to *DYNAMICALLY* do mode setting instead of<br>
static configuring weston at the very beginning.<br>
<br>
Weston protocol wrandr will provide interface to<br>
1) set output mode<br>
2) set output transform<br>
3) move output to relative position<br>
4) provide disconnected output information<br>
<br>
Currently randr has more functions to be defined and implemented.<br>
Some other functions are planned. But at first we need support.<br>
If this protocol is accepted, we could have the chance moving on.<br>
<br>
The advantage is<br>
randr architecture have been defined at this commit. New function will<br>
be very easy to be added in the protocol.<br>
<br>
One note:<br>
Currently wl_output doesn't provide wl_output_send_name function,<br>
I have to implemented it in randr protocol. Actually it will be very<br>
easily implemented in wl_output interface. If this commit series is<br>
accepted, I will provide the patch to add wl_output_send_name to make<br>
issue simply resolved instead of in randr protocol.<br>
'<br>
<br>
Here are some test cases.<br>
<br>
1. weston-randr -q # query all output mode info and disconnected output<br>
<br>
HDMI3<br>
1)1440x900@60 (current)<br>
2)1920x1200@60<br>
3)1680x1050@60<br>
...<br>
<br>
VGA1<br>
1)1280x1024@60 (current)<br>
2)1152x864@60<br>
3)1024x768@60<br>
...<br>
<br>
HDMI1 disconnected<br>
HDMI2 disconnected<br>
DP1 disconnected<br>
DP2 disconnected<br>
...<br>
<br>
2. weston-randr --output HDMI3 # query HDMI3 output mode info<br>
<br>
HDMI3<br>
1)1440x900@60 (current)<br>
2)1920x1200@60<br>
3)1680x1050@60<br>
<br>
3. weston-randr --output HDMI3 -m 2 # which will set mode as 1920x1200<br>
<br>
4. weston-randr --output HDMI3 -R 1 # rotate HDMI3 output 90 degree<br>
<br>
5. weston-randr --output HDMI3 -leftof VGA1 # put HDMI3 output leftof VGA1<br>
<br>
6. weston-randr --output HDMI3 -rightof VGA1 # put HDMI3 output rightof VGA1<br>
<br>
Quanxian Wang (6):<br>
  Add weston randr protocol<br>
  Add weston_randr definition and randr_backend intreface<br>
  Add the detailed implementation of randr protocol<br>
  Initialize the randr interface in drm backend<br>
  Add weston-randr application<br>
  Change the size of Panel and Background after output's is changed<br>
<br>
 clients/Makefile.am     |   9 +<br>
 clients/desktop-shell.c |  60 +++++<br>
 clients/window.c        |   7 +<br>
 clients/window.h        |   2 +<br>
 clients/wrandr.c        | 642 ++++++++++++++++++++++++++++++++++++++++++++++++<br>
 protocol/Makefile.am    |   1 +<br>
 protocol/randr.xml      | 151 ++++++++++++<br>
 src/Makefile.am         |   4 +<br>
 src/compositor-drm.c    |  67 +++++<br>
 src/compositor.c        | 466 +++++++++++++++++++++++++++++++----<br>
 src/compositor.h        |  14 ++<br>
 11 files changed, 1376 insertions(+), 47 deletions(-)<br>
 create mode 100644 clients/wrandr.c<br>
 create mode 100644 protocol/randr.xml<br>
<span style="color:#888888"><br>
<span class="hoenzb">--</span><br>
<span class="hoenzb">1.8.1.2</span><br>
<br>
<span class="hoenzb">_______________________________________________</span><br>
<span class="hoenzb">wayland-devel mailing list</span><br>
<span class="hoenzb"><a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a></span><br>
<span class="hoenzb"><a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a></span></span><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>