[PATCH V2 0/8] Add weston randr protocol
Quanxian Wang
quanxian.wang at intel.com
Mon Mar 24 04:39:12 PDT 2014
Important Changes:
1) Adding randr_commit, randr_delmode, randr_newmode, randr_start
randr_commit: will commit all requests in one time.
randr_delmode: delete one mode
randr_newmode: new one mode
randr_start: as the randr beginning, it will generate a callback
interface to keep tunning the commit.
2) Add wrandr_callback interface for tunning. (randr_start)
3) Add new request structure in compositor to store all the requests.
This structure is easy to control every client request set on one output.
4) Delete original design: one request has one default commit. It is not convenient
for group operations. Using commit request to submit all the request
in one time.
5) Take wrandr as a module
6) Add --enable-wrandr option to enable wrandr.
7) For 8th patch, it is still under consideration. It is only one choice.
But I am not sure if other agrees with that.
Hints:
This patches series has been tested. Until now it works fine.
If you want to have a try, you need two patches I send before.
1) [PATCH 0/3] Add wl_output name event
2) [PATCH] desktop-shell: Bug fix client apps because of output change
When you build weston, add option --enable-wrandr to enable the build of weston randr.
TODO:
>From Pq's comment, delete mode or set mode could not identify one unique mode using
parameters width, height and refresh. Currently there is no method to get drmModeinfo
from compistor. (wl_output_send_mode only send width, height and refresh).
Using new mode, user knows the parameter. However mode delete or mode set,
user could not get the detailed parameters from client. I will check with others to
get more idea to make sure how to implement that. Any comment is welcome.
By the way, currently we are focus on the protocol design. The implemented code is just
a reference. However it will be helpful for reviewer to have a test and get the clear
idea of protocol. I like your comment to make this protocol stronger. Thanks.
Especially thanks to Pq. He gives me more valuable information. I will continue keep
tuning your comment and make the change.
Thanks for your support.
Regards
Quanxian Wang
General Information:
Objective:
Randr interface will not be exposed. It is only for weston-specific.
and it is only for testing and configuration.
The idea is from xrandr provided by xserver. *Dynamic* mode
setting is the main objective of this protocol. Remember,
it is one shot operation. For example, if setting the mode,
just call one request wl_randr_set_mode. If you want to make
sure if it is successful, you need to keep tuning done event.
after all, it is a protocol communication.
With this protocol, weston-wrandr application is developped to help
implement randr protocol in command line just like xrandr command
in xserver.
Weston protocol wrandr will provide interface to
1) Mode set of output (scale, transform, mode)
2) Position of output (currently support leftof, rightof)
3) New a custom mode
4) Delete mode
Here are some use cases.
1. weston-randr -q # query all output mode info and disconnected output
HDMI3
1)1440x900 at 60 (current)
2)1920x1200 at 60
3)1680x1050 at 60
...
VGA1
1)1280x1024 at 60 (current)
2)1152x864 at 60
3)1024x768 at 60
...
2. weston-randr --output HDMI3 # query HDMI3 output mode info
HDMI3
1)1440x900 at 60 (current)
2)1920x1200 at 60
3)1680x1050 at 60
3. weston-randr --output HDMI3 --mode 2 # which will set mode as 1920x1200
or weston-randr --output HDMI3 --mode 1920x1200 at 60
or weston-randr --output HDMI3 --mode 1920x1200
4. weston-randr --output HDMI3 --transform 1 # rotate HDMI3 output 90 degree
5. weston-randr --output HDMI3 --leftof VGA1 # put HDMI3 output leftof VGA1
Group operations example:
5. weston-randr --output HDMI3 --transform 3 --scale 2 --mode 2 -leftof VGA1
6. weston-randton-wrandr --output HDMI3 --transform 1 --scale 2 --mode 2 --rightof VGA1 --newmode='1000,300,100,120,150,400,350,370,399,+hsync,-vsync'
7. weston-randton-wrandr --output HDMI3 --delmode 3
or weston-randton-wrandr --output HDMI3 --delmode 1920x1200 at 60
Quanxian Wang (8):
wesston: Add weston randr protocol
weston: Add the weston randr support in compositor.h
weston: Add enable-wrandr option in compositor to load wrandr.so
Add new mode function in drm backend
weston:Add the weston randr protocol implementation
weston: Add configure to support wrandr.
Apps: Add weston-randr application
Add request_id for request set to be distinguished from others
Makefile.am | 5 +
clients/Makefile.am | 9 +
clients/wrandr.c | 879 ++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 8 +
module/Makefile.am | 3 +
module/wrandr/Makefile.am | 32 ++
module/wrandr/wrandr.c | 803 ++++++++++++++++++++++++++++++++++++++++++
protocol/Makefile.am | 1 +
protocol/randr.xml | 236 +++++++++++++
src/compositor-drm.c | 67 ++++
src/compositor.c | 14 +-
src/compositor.h | 28 ++
12 files changed, 2083 insertions(+), 2 deletions(-)
create mode 100644 clients/wrandr.c
create mode 100644 module/Makefile.am
create mode 100644 module/wrandr/Makefile.am
create mode 100644 module/wrandr/wrandr.c
create mode 100644 protocol/randr.xml
--
1.8.1.2
More information about the wayland-devel
mailing list