RSurfaceUpdateSession Class Reference

class RSurfaceUpdateSession : public RSessionBase

The RSurfaceUpdateSession class is intended to be used by surface update control flow. The class implements an interface between the Compositor and clients. It allows a client to inform the Compositor when a surface has been modified and to receive notification when its buffer becomes available and/or displayed.

Inherits from

Public Member Functions
RSurfaceUpdateSession()
IMPORT_C voidCancelAllUpdateNotifications()
IMPORT_C voidClose()
IMPORT_C TIntConnect(TInt)
IMPORT_C voidNotifyWhenAvailable(TRequestStatus &)
IMPORT_C voidNotifyWhenDisplayed(TRequestStatus &, TTimeStamp &)
IMPORT_C voidNotifyWhenDisplayedXTimes(TInt, TRequestStatus &)
IMPORT_C TIntSubmitUpdate(TInt, const TSurfaceId &, TInt, const TRegion *)
Protected Member Functions
TVersion Version()
Private Member Functions
voidIssueRequestComplete(TInt)
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TInt iCount
TRequestStatus *iStatusAvailable
TRequestStatus *iStatusDisplayed
TRequestStatus *iStatusDisplayedXTimes
TTimeStamp *iTimeStamp
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RSurfaceUpdateSession()

IMPORT_CRSurfaceUpdateSession()

Member Functions Documentation

CancelAllUpdateNotifications()

IMPORT_C voidCancelAllUpdateNotifications()

Cancel all outstanding requests for notification. The function doesn't cancel the submit update requests themselves.

Pre-condition
The surface session must be established to the server.
Post-condition
The server will issue request complete immediately for all outstanding requests related to particular session. Will panic if applied on disconnected session.

Close()

IMPORT_C voidClose()

Close the session to the server.

Pre-condition
Outstanding notification requests (if any) are cancelled.
Post-condition
The session is disconnected.

Connect(TInt)

IMPORT_C TIntConnect(TIntaMessageSlots =  KDefaultMessageSlot )

Connect to the server using given number of message slots.

RSessionBase
Pre-condition
The surface update server is started up
Post-condition
Connection to the server has been established.

Parameters

TInt aMessageSlots =  KDefaultMessageSlot The number of message slots available to this session. This parameter is defined in RSessionBase specification; it signifies the maximum number of asynchronous outstanding requests to the server. SubmitUpdate commands could contain up to three asynchronous requests to the server, each corresponds to a different type of notification.

IssueRequestComplete(TInt)

voidIssueRequestComplete(TIntaErr)[private]

Parameters

TInt aErr

NotifyWhenAvailable(TRequestStatus &)

IMPORT_C voidNotifyWhenAvailable(TRequestStatus &aStatus)

The message signals the client that the buffer associated with the notifier is available for further updates.

For performance reasons, the GCE uses the buffer sent by the client for composition directly rather than composing with a copy of the buffer. This means that, potentially, a client could be rendering to a buffer which is currently being used for composition, leading to artefacts and possible tearing. Depending on whether the surface is single or multi-buffered, there is some difference in behaviour: In the case of single-buffered surfaces, the GCE will not wait for the next submit update and will complete the request after the composition. In case of multi-buffered surfaces, the GCE can postpone with the issuing the notification to the client even after the composition with the specified surface buffer has already happened, and issues the request when the client changes the active buffer, i.e. submits another request for update with different buffer. This will help the GCE to keep the active buffer in a valid state should another composition required.

This notification enables a client to, if desired, be able to perform artefact free rendering using this notification in conjunction with a multi-buffered surface.

Note that since the compositor can delay to issue request complete for multi-buffered surface until the change of the active buffer occurs, the completion of a particular notifier may not relate to the buffer to which it is intuitively associated.

Only the last call of this function before SubmitUpdate command takes place will have effect, i.e. the following call will override the previous one. This request will only be associated with the following single call of the SubmitUpdate.

When a SubmitUpdate has been broadcast to all available screen, i.e. KAllScreens was supplied as a screen number, for multi-buffered surfaces, the notification will be completed when the surface buffer has been released by all displays it is being shown on. For single-buffered surfaces, notification will be completed when all displays have read the buffer once.

RSurfaceUpdateSession::SubmitUpdate
Pre-condition
The surface session must be established to the server.
Post-condition
This request for the consumption notification event will be transferred to the GCE at next SubmitUpdate command.
If an application such as video is using three (or more) buffers, this error can occur. For instance, the video may be producing frames at a fixed rate which is faster than the GCE can cope with, and in this case frames will be lost , but the notification mechanism will still operate correctly.

Parameters

TRequestStatus & aStatusReference to the request status object.

NotifyWhenDisplayed(TRequestStatus &, TTimeStamp &)

IMPORT_C voidNotifyWhenDisplayed(TRequestStatus &aStatus,
TTimeStamp &aTimeStamp
)

Ask the server to notify when the surface buffer which will be specified in the next update request has been displayed for the first time. The notification will also include exact time of the event as it is supplied by the User::FastCounter(). Only the last call of this function before SubmitUpdate command takes place will have effect, i.e. the following call will override the previous one.

RSurfaceUpdateSession::SubmitUpdate
Pre-condition
The surface session must be established to the server.
Post-condition
This request for the display notification event will be transferred to the GCE at next SubmitUpdate command.
RSurfaceUpdateSession::Connect for details).

Parameters

TRequestStatus & aStatusReference to the request status object.
TTimeStamp & aTimeStampReference to the timestamp of the display notification event, packed into the modified buffer descriptor. Will only be valid if aStatus is equal to KErrNone.

NotifyWhenDisplayedXTimes(TInt, TRequestStatus &)

IMPORT_C voidNotifyWhenDisplayedXTimes(TIntaCount,
TRequestStatus &aStatus
)

Ask the server to notify when the surface buffer which will be specified in the next update request has been displayed for the X times.

Only the last call of this function before SubmitUpdate command takes place will have effect, i.e. the following call will override the previous one.

In case of the global update the notification will always be aligned with the master display. The SUS will send notification to client when the surface has been displayed on a master display for the X times or if there is no master display for that surface. If the master becomes invisible while the request is still in a progress it will be reassigned to the next visible display with highest priority.

This request will only be associated with the following single call of the SubmitUpdate.

Pre-condition
The surface session must be established to the server.
Post-condition
This request for the display notification event will be transferred to the GCE at next SubmitUpdate command.
RSurfaceUpdateSession::Connect for details).

Parameters

TInt aCountNumber of times the surface is displayed before the request is completed. Varies from 1 and greater.
TRequestStatus & aStatusReference to the request status object.

SubmitUpdate(TInt, const TSurfaceId &, TInt, const TRegion *)

IMPORT_C TIntSubmitUpdate(TIntaScreen,
const TSurfaceId &aSurfaceId,
TIntaBuffer,
const TRegion *aDirtyRegion = NULL
)

Send update message to the server. All notification requests will also be submitted at this stage. This is referring to when notifications are requested before the update request.

The GCE may collapse a few requests into one. If a few requests with different buffer numbers specified for the same surface have been submitted at specific composition cycle, only last such request will have effect.

Clients can send a global submit update which will be broadcast by the SUS to all backends presented in the system. For a global update, to all screens, the pre-defined constant KAllScreens needs to be passed as the screen parameter to SubmitUpdate. Note that once a Client has begun issuing SubmitUpdate with either KAllScreens or a specific screen, then only that type of screen can be used thereafter for that Surface Update Session, i.e. the client cannot have a mix of SubmitUpdate with KAllScreens and specific screens.

RSurfaceUpdateSession::NotifyWhenAvailable RSurfaceUpdateSession::NotifyWhenDisplayed RSurfaceUpdateSession::NotifyWhenDisplayedXTimes
Pre-condition
The surface session must be established to the server.
Post-condition
The GCE will trigger composition to use this region at the next composition cycle.

Parameters

TInt aScreenScreen number. KAllScreens is the only allowed parameter.
const TSurfaceId & aSurfaceIdSecure 128-bit surface unique identifier, which fully specified the surface. Surface ID must be assigned and registered with the GCE.
TInt aBufferCurrent buffer for composition. Varies from 0 to N-1, where N is the total number of buffers in the surface.
const TRegion * aDirtyRegion = NULL

Version()

TVersion Version()const [protected]

Allow to retrieve the version number.

Member Data Documentation

TInt iCount

TInt iCount[private]

TRequestStatus * iStatusAvailable

TRequestStatus *iStatusAvailable[private]

TRequestStatus * iStatusDisplayed

TRequestStatus *iStatusDisplayed[private]

TRequestStatus * iStatusDisplayedXTimes

TRequestStatus *iStatusDisplayedXTimes[private]

TTimeStamp * iTimeStamp

TTimeStamp *iTimeStamp[private]