summary |
shortlog | log |
commit |
commitdiff |
review |
tree
first ⋅ prev ⋅ next
Damian Hobson-Garcia [Wed, 16 Mar 2022 01:10:39 +0000 (10:10 +0900)]
test/lease-manager: Create dummy fds for fake lease grants
drmModeCreateLease() should return a new lease fd for every succesful call.
Make sure that our dummy implementation does the same.
Returning 0 will cause stdout to be closed at the end of each test,
which will break the test logging when tests are run without forking
(ie. when CK_FORK=no)
Change-Id: I6b9436a962fb25b88576ae1c950c4f6f698e949a
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Damian Hobson-Garcia [Thu, 16 Sep 2021 09:07:54 +0000 (18:07 +0900)]
log: Add line number to debug log output
Some debug logging, such as memory allocation failure, uses similar
log messageing in several places. Add the file line number to
the debug log to help differentiate where notable errors occured.
Change-Id: I2151e21533716ea0badbb6303b713e644b544e6d
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Jan-Simon Möller [Tue, 13 Jul 2021 13:44:34 +0000 (15:44 +0200)]
Add .gitreview file
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Damian Hobson-Garcia [Mon, 12 Apr 2021 07:43:57 +0000 (16:43 +0900)]
Don't close invalid or uninitialied fds
Avoid calling close() on file descriptors that have not been intialized,
(or initialized to 0) and descriptors that are known to be invalid.
Closing file descriptors due to handle failing initialization is handled
in the intialization code. In the lease-manager, file descriptors can be
invalid during normal operation, so validity is tested at shutdown.
Bug-AGL: SPEC-3862
Change-Id: I798273195cba297c14c6b97d50c7614164fda7df
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Damian Hobson-Garcia [Mon, 22 Mar 2021 02:54:16 +0000 (11:54 +0900)]
Add option to hold lease on unexpected disconnect
If a client application crashes while owning a lease,
the lease will automatically be revoked and all references
freed to make it available for another (or the restarted
original) client to claim and continue display. This will
cause the screen to blank while the lease is unowned.
Add an option to revoke the lease, but keep the reference to
the lease descriptor, so that the screen does not blank while
unowned.
This only has effect when a client exits without calling the
`dlm_release_lease` function. Otherwise the lease is revoked
and the descriptor dereferenced, just as before.
Bug-AGL: SPEC-3862
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Change-Id: I3fc2c8fde4118b6e298ba31807fd5fa4766a97dd
Damian Hobson-Garcia [Fri, 19 Feb 2021 04:12:16 +0000 (04:12 +0000)]
Move lease fd send/receive to dlm-protocol
Collect all protocol related functionality in the same
place instead of spreading it around across different
modules.
Bug-AGL: SPEC-3862
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Change-Id: I169a200401e4feaa289d53240a7f5467d6a88bd3
Damian Hobson-Garcia [Fri, 19 Feb 2021 03:52:55 +0000 (03:52 +0000)]
Add lease request and release protocol
Explicitly request / release leases instead of implicitly
by opening and closing the connection. This will allow the
lease manager to take different action when a client
shuts down gracefully vs when it crashes, holding a lease.
Bug-AGL: SPEC-3862
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Change-Id: Ibc68bee855ce18e56eb6f57e5ad1743248320013
Damian Hobson-Garcia [Fri, 19 Mar 2021 07:04:35 +0000 (16:04 +0900)]
Free old lease fd reference after transition
After a lease is tranisitined to a new client, the reference to
the previous client's lease fd is no longer needed and should
be released.
Close the old fd after the new client has either updated the
display or its lease is revoked.
Bug-AGL: SPEC-3816
Change-Id: I9612913e2960dce94bcfc6a35c0105a5670a453d
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Damian Hobson-Garcia [Tue, 9 Mar 2021 05:58:22 +0000 (14:58 +0900)]
Add support for lease transition
When enabled allow the ownership of a lease to transition from
one client to another.
If a request is made for a lease that is already allocated to
a client, revoke the lease from the old client and issue a new
lease for the same resources to the new client.
This allows the ownership of the leased resources to be transferred
without the display being closed and the screen blanking.
During the tranistion, hold a reference to the old clients lease fd so
that the last frame presented by the old client will remain on screen until
the new client presents its first frame.
Currenly there is no notification or authentication mechanism
implemeted for the transition. Any client can request a transition
from any other. The only notification that a transfer has happened
is that the previous client's DRM API calls will suddenly fail with
-ENOENT, since all resources will have been removed.
It is up to the client to sensibly handle this condition.
Bug-AGL: SPEC-3816
Change-Id: Iaff87e275f909f3b6ef448df39364d6fe62007b1
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Damian Hobson-Garcia [Tue, 9 Mar 2021 03:05:29 +0000 (12:05 +0900)]
lease-server: Allow multiple client connections
Allow multiple clients to issue lease requests
on a server at the same time. This is
necessary to be able to grant or deny leases,
not just on a first-come-first-served basis.
Future patches will add extra contitions,
such as command-line options and lease configuration
settings to determine when and how lease requests should
be granted.
This update changes the behaviour of the lease-server interface
so that it reports every client connection request, instead of
when a server has accepted a request, so update the test suite to
reflect this.
Bug-AGL: SPEC-3816
Change-Id: I48cc392dd62a8c06ea74178bc52c627032817203
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Damian Hobson-Garcia [Tue, 9 Mar 2021 04:25:41 +0000 (13:25 +0900)]
lease-server-test: Destroy server on shutdown
libcheck tests normally run each test in a separate process
so the server objects will automatically be destroyed after
each test. If the test suite is run with CK_FORK=no, for
example when debugging the test with gdb, failing to
destory the server object will leave the test sockets
from the previous test open, which will stop the next
test from creating its own sockets.
Bug-AGL: SPEC-3816
Change-Id: I42a0976c392bdc19bb60acc78178aac8ee3e14ce
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Damian Hobson-Garcia [Tue, 24 Nov 2020 08:16:39 +0000 (17:16 +0900)]
Add initial version
The initial version implements the basic functionality
of the client/server communication and lease management.
For now, one lease is created per valid connector (dependent
on CRTC availablity).
Bug-AGL: SPEC-3729
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Change-Id: I2b37a892742cc22bdc53a5172c8ad3d8a7bb5e66
Jan-Simon Moeller [Fri, 4 Dec 2020 01:24:58 +0000 (01:24 +0000)]
Initial empty repository