102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci    NV_stream_origin
402f4aeb0Sopenharmony_ci
502f4aeb0Sopenharmony_ciName Strings
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci    EGL_NV_stream_origin
802f4aeb0Sopenharmony_ci
902f4aeb0Sopenharmony_ciContributors
1002f4aeb0Sopenharmony_ci
1102f4aeb0Sopenharmony_ci    Miguel A. Vico
1202f4aeb0Sopenharmony_ci    James Jones
1302f4aeb0Sopenharmony_ci    Daniel Kartch
1402f4aeb0Sopenharmony_ci
1502f4aeb0Sopenharmony_ciContacts
1602f4aeb0Sopenharmony_ci
1702f4aeb0Sopenharmony_ci    Miguel A. Vico (mvicomoya 'AT' nvidia.com)
1802f4aeb0Sopenharmony_ci
1902f4aeb0Sopenharmony_ciStatus
2002f4aeb0Sopenharmony_ci
2102f4aeb0Sopenharmony_ci    Complete.
2202f4aeb0Sopenharmony_ci
2302f4aeb0Sopenharmony_ciVersion
2402f4aeb0Sopenharmony_ci
2502f4aeb0Sopenharmony_ci    Version 5 - May 20, 2019
2602f4aeb0Sopenharmony_ci
2702f4aeb0Sopenharmony_ciNumber
2802f4aeb0Sopenharmony_ci
2902f4aeb0Sopenharmony_ci    134
3002f4aeb0Sopenharmony_ci
3102f4aeb0Sopenharmony_ciExtension Type
3202f4aeb0Sopenharmony_ci
3302f4aeb0Sopenharmony_ci    EGL display extension
3402f4aeb0Sopenharmony_ci
3502f4aeb0Sopenharmony_ciDependencies
3602f4aeb0Sopenharmony_ci
3702f4aeb0Sopenharmony_ci    Requires the EGL_KHR_stream extension.
3802f4aeb0Sopenharmony_ci
3902f4aeb0Sopenharmony_ci    This extension is written based on the wording of version 26 of the
4002f4aeb0Sopenharmony_ci    EGL_KHR_stream extension.
4102f4aeb0Sopenharmony_ci
4202f4aeb0Sopenharmony_ciOverview
4302f4aeb0Sopenharmony_ci
4402f4aeb0Sopenharmony_ci    EGL does not define a frame orientation.  However, window systems or
4502f4aeb0Sopenharmony_ci    rendering APIs might.
4602f4aeb0Sopenharmony_ci
4702f4aeb0Sopenharmony_ci    Ideally, when using EGL streams, frame orientation is agreed upon by
4802f4aeb0Sopenharmony_ci    both the connected consumer and producer and appropriate handling is
4902f4aeb0Sopenharmony_ci    performed within EGL to satisfy both endpoints needs.  Thus,
5002f4aeb0Sopenharmony_ci    applications will rarely have to worry about frame orientation.
5102f4aeb0Sopenharmony_ci
5202f4aeb0Sopenharmony_ci    However, in some cases consumer applications such as compositors
5302f4aeb0Sopenharmony_ci    might still need to access the frame data as provided by the
5402f4aeb0Sopenharmony_ci    consumer.  Hence, they need to know what orientation was set for the
5502f4aeb0Sopenharmony_ci    stream frames.  This will allow applications to adjust the way they
5602f4aeb0Sopenharmony_ci    access the frame data.
5702f4aeb0Sopenharmony_ci
5802f4aeb0Sopenharmony_ci    Similarly, producer applications might need to adjust how rendering
5902f4aeb0Sopenharmony_ci    commands are issued depending on the orientation set for the stream
6002f4aeb0Sopenharmony_ci    frames.
6102f4aeb0Sopenharmony_ci
6202f4aeb0Sopenharmony_ci    This extension provides new attributes to allow EGL stream users to
6302f4aeb0Sopenharmony_ci    query frame orientation and whether it is handled automatically by
6402f4aeb0Sopenharmony_ci    the producer or consumer endpoints so that clients are not required
6502f4aeb0Sopenharmony_ci    to take further actions.
6602f4aeb0Sopenharmony_ci
6702f4aeb0Sopenharmony_ciNew Functions
6802f4aeb0Sopenharmony_ci
6902f4aeb0Sopenharmony_ci    None.
7002f4aeb0Sopenharmony_ci
7102f4aeb0Sopenharmony_ciNew Tokens
7202f4aeb0Sopenharmony_ci
7302f4aeb0Sopenharmony_ci    Accepted as the <attribute> parameter of eglQueryStreamKHR and
7402f4aeb0Sopenharmony_ci    eglQueryStreamAttribKHR:
7502f4aeb0Sopenharmony_ci
7602f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_X_NV             0x3366
7702f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_Y_NV             0x3367
7802f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_MAJOR_AXIS_NV           0x3368
7902f4aeb0Sopenharmony_ci
8002f4aeb0Sopenharmony_ci    EGL_CONSUMER_AUTO_ORIENTATION_NV         0x3369
8102f4aeb0Sopenharmony_ci    EGL_PRODUCER_AUTO_ORIENTATION_NV         0x336A
8202f4aeb0Sopenharmony_ci
8302f4aeb0Sopenharmony_ci    Returned by eglQueryStreamKHR and eglQueryStreamAttribKHR when
8402f4aeb0Sopenharmony_ci    attribute is EGL_STREAM_FRAME_ORIGIN_X_NV:
8502f4aeb0Sopenharmony_ci
8602f4aeb0Sopenharmony_ci    EGL_LEFT_NV                              0x336B
8702f4aeb0Sopenharmony_ci    EGL_RIGHT_NV                             0x336C
8802f4aeb0Sopenharmony_ci
8902f4aeb0Sopenharmony_ci    Returned by eglQueryStreamKHR and eglQueryStreamAttribKHR when
9002f4aeb0Sopenharmony_ci    attribute is EGL_STREAM_FRAME_ORIGIN_Y_NV:
9102f4aeb0Sopenharmony_ci
9202f4aeb0Sopenharmony_ci    EGL_TOP_NV                               0x336D
9302f4aeb0Sopenharmony_ci    EGL_BOTTOM_NV                            0x336E
9402f4aeb0Sopenharmony_ci
9502f4aeb0Sopenharmony_ci    Returned by eglQueryStreamKHR and eglQueryStreamAttribKHR when
9602f4aeb0Sopenharmony_ci    attribute is EGL_STREAM_FRAME_MAJOR_AXIS_NV:
9702f4aeb0Sopenharmony_ci
9802f4aeb0Sopenharmony_ci    EGL_X_AXIS_NV                            0x336F
9902f4aeb0Sopenharmony_ci    EGL_Y_AXIS_NV                            0x3370
10002f4aeb0Sopenharmony_ci
10102f4aeb0Sopenharmony_ciAdd to table "3.10.4.4 EGLStream Attributes"
10202f4aeb0Sopenharmony_ci
10302f4aeb0Sopenharmony_ci    Attribute                         Read/Write Type       Section
10402f4aeb0Sopenharmony_ci    --------------------------------- ---------- ---------- -----------
10502f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_X_NV          ro     EGLint     3.10.4.x
10602f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_Y_NV          ro     EGLint     3.10.4.x+1
10702f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_MAJOR_AXIS_NV        ro     EGLint     3.10.4.x+2
10802f4aeb0Sopenharmony_ci    EGL_CONSUMER_AUTO_ORIENTATION_NV      ro     EGLBoolean 3.10.4.x+3
10902f4aeb0Sopenharmony_ci    EGL_PRODUCER_AUTO_ORIENTATION_NV      ro     EGLBoolean 3.10.4.x+4
11002f4aeb0Sopenharmony_ci
11102f4aeb0Sopenharmony_ciAdd new subsections to the end of section "3.10.4 EGLStream Attributes"
11202f4aeb0Sopenharmony_ciin EGL_KHR_stream:
11302f4aeb0Sopenharmony_ci
11402f4aeb0Sopenharmony_ci    3.10.4.x EGL_STREAM_FRAME_ORIGIN_X_NV
11502f4aeb0Sopenharmony_ci
11602f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_X_NV is a read-only attribute that
11702f4aeb0Sopenharmony_ci    indicates the position on the X axis of the origin relative to the
11802f4aeb0Sopenharmony_ci    stream images surface as agreed upon by consumer and producer.
11902f4aeb0Sopenharmony_ci
12002f4aeb0Sopenharmony_ci    The relative position on X may be one of the following:
12102f4aeb0Sopenharmony_ci
12202f4aeb0Sopenharmony_ci        - EGL_LEFT_NV - Coordinates on the X axis will be 0 on the left
12302f4aeb0Sopenharmony_ci          border and increase towards the right border until <frame
12402f4aeb0Sopenharmony_ci          width> is reached.
12502f4aeb0Sopenharmony_ci
12602f4aeb0Sopenharmony_ci        - EGL_RIGHT_NV - Coordinates on the X axis will be <frame width>
12702f4aeb0Sopenharmony_ci          on the left border and decrease towards the right border until
12802f4aeb0Sopenharmony_ci          0 is reached.
12902f4aeb0Sopenharmony_ci
13002f4aeb0Sopenharmony_ci        - EGL_DONT_CARE - No orientation on the X axis was set by the EGL
13102f4aeb0Sopenharmony_ci          implementation.  Applications must coordinate what they are
13202f4aeb0Sopenharmony_ci          doing.
13302f4aeb0Sopenharmony_ci
13402f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_X_NV will not be defined until a consumer
13502f4aeb0Sopenharmony_ci    and a producer are connected to the stream.  Querying it before that
13602f4aeb0Sopenharmony_ci    will generate an EGL_BAD_STATE_KHR error.
13702f4aeb0Sopenharmony_ci
13802f4aeb0Sopenharmony_ci
13902f4aeb0Sopenharmony_ci    3.10.4.x+1 EGL_STREAM_FRAME_ORIGIN_Y_NV
14002f4aeb0Sopenharmony_ci
14102f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_Y_NV is a read-only attribute that
14202f4aeb0Sopenharmony_ci    indicates the position on the Y axis of the origin relative to the
14302f4aeb0Sopenharmony_ci    stream images surface as agreed upon by consumer and producer.
14402f4aeb0Sopenharmony_ci
14502f4aeb0Sopenharmony_ci    The relative position on Y may be one of the following:
14602f4aeb0Sopenharmony_ci
14702f4aeb0Sopenharmony_ci        - EGL_TOP_NV - Coordinates on the Y axis will be 0 on the top
14802f4aeb0Sopenharmony_ci          border and increase towards the bottom border until <frame
14902f4aeb0Sopenharmony_ci          height> is reached.
15002f4aeb0Sopenharmony_ci
15102f4aeb0Sopenharmony_ci        - EGL_BOTTOM_NV - Coordinates on the Y axis will be <frame
15202f4aeb0Sopenharmony_ci          height> on the top border and decrease towards the bottom
15302f4aeb0Sopenharmony_ci          border until 0 is reached.
15402f4aeb0Sopenharmony_ci
15502f4aeb0Sopenharmony_ci        - EGL_DONT_CARE - No orientation on the Y axis was set by the EGL
15602f4aeb0Sopenharmony_ci          implementation.  Applications must coordinate what they are
15702f4aeb0Sopenharmony_ci          doing.
15802f4aeb0Sopenharmony_ci
15902f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_ORIGIN_Y_NV will not be defined until a consumer
16002f4aeb0Sopenharmony_ci    and a producer are connected to the stream.  Querying it before that
16102f4aeb0Sopenharmony_ci    will generate an EGL_BAD_STATE_KHR error.
16202f4aeb0Sopenharmony_ci
16302f4aeb0Sopenharmony_ci
16402f4aeb0Sopenharmony_ci    3.10.4.x+2 EGL_STREAM_FRAME_MAJOR_AXIS_NV
16502f4aeb0Sopenharmony_ci
16602f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_MAJOR_AXIS_NV is a read-only attribute that
16702f4aeb0Sopenharmony_ci    indicates whether the stream images are X-major or Y-major.
16802f4aeb0Sopenharmony_ci
16902f4aeb0Sopenharmony_ci    The major axis may be one of the following:
17002f4aeb0Sopenharmony_ci
17102f4aeb0Sopenharmony_ci        - EGL_X_AXIS_NV - Frames are laid out such that consecutive
17202f4aeb0Sopenharmony_ci          pixels with same Y coordinate reside next to each other in
17302f4aeb0Sopenharmony_ci          memory.
17402f4aeb0Sopenharmony_ci
17502f4aeb0Sopenharmony_ci        - EGL_Y_AXIS_NV - Frames are laid out such that consecutive
17602f4aeb0Sopenharmony_ci          pixels with same X coordinate reside next to each other in
17702f4aeb0Sopenharmony_ci          memory.
17802f4aeb0Sopenharmony_ci
17902f4aeb0Sopenharmony_ci        - EGL_DONT_CARE - No major axis was set by the EGL
18002f4aeb0Sopenharmony_ci          implementation.  Applications must coordinate what they are
18102f4aeb0Sopenharmony_ci          doing.
18202f4aeb0Sopenharmony_ci
18302f4aeb0Sopenharmony_ci    EGL_STREAM_FRAME_MAJOR_AXIS_NV will not be defined until a consumer
18402f4aeb0Sopenharmony_ci    and a producer are connected to the stream.  Querying it before that
18502f4aeb0Sopenharmony_ci    will generate an EGL_BAD_STATE_KHR error.
18602f4aeb0Sopenharmony_ci
18702f4aeb0Sopenharmony_ci
18802f4aeb0Sopenharmony_ci    3.10.4.x+3 EGL_CONSUMER_AUTO_ORIENTATION_NV
18902f4aeb0Sopenharmony_ci
19002f4aeb0Sopenharmony_ci    EGL_CONSUMER_AUTO_ORIENTATION_NV is a read-only attribute that
19102f4aeb0Sopenharmony_ci    indicates whether the consumer endpoint will handle frame orientation
19202f4aeb0Sopenharmony_ci    automatically so that the consumer application is not required to
19302f4aeb0Sopenharmony_ci    take further actions.
19402f4aeb0Sopenharmony_ci
19502f4aeb0Sopenharmony_ci    The following values can be returned:
19602f4aeb0Sopenharmony_ci
19702f4aeb0Sopenharmony_ci        - EGL_TRUE - The consumer application can read frames as normal.
19802f4aeb0Sopenharmony_ci          The consumer will flip images as needed if the expected
19902f4aeb0Sopenharmony_ci          orientation does not match.
20002f4aeb0Sopenharmony_ci
20102f4aeb0Sopenharmony_ci        - EGL_FALSE - The consumer application is expected to query the
20202f4aeb0Sopenharmony_ci          frame orientation and process images accordingly if it does not
20302f4aeb0Sopenharmony_ci          match with the expected orientation.
20402f4aeb0Sopenharmony_ci
20502f4aeb0Sopenharmony_ci    EGL_CONSUMER_AUTO_ORIENTATION_NV will not be defined until a consumer
20602f4aeb0Sopenharmony_ci    and a producer are connected to the stream.  Querying it before that
20702f4aeb0Sopenharmony_ci    will generate an EGL_BAD_STATE_KHR error.
20802f4aeb0Sopenharmony_ci
20902f4aeb0Sopenharmony_ci
21002f4aeb0Sopenharmony_ci    3.10.4.x+4 EGL_PRODUCER_AUTO_ORIENTATION_NV
21102f4aeb0Sopenharmony_ci
21202f4aeb0Sopenharmony_ci    EGL_PRODUCER_AUTO_ORIENTATION_NV is a read-only attribute that
21302f4aeb0Sopenharmony_ci    indicates whether the producer endpoint will handle frame orientation
21402f4aeb0Sopenharmony_ci    automatically so that the producer application is not required to
21502f4aeb0Sopenharmony_ci    take further actions.
21602f4aeb0Sopenharmony_ci
21702f4aeb0Sopenharmony_ci    The following values can be returned:
21802f4aeb0Sopenharmony_ci
21902f4aeb0Sopenharmony_ci        - EGL_TRUE - The producer application can generate frames as
22002f4aeb0Sopenharmony_ci          normal.  The producer will flip images as needed if the
22102f4aeb0Sopenharmony_ci          expected orientation does not match.
22202f4aeb0Sopenharmony_ci
22302f4aeb0Sopenharmony_ci        - EGL_FALSE - The producer application is expected to query the
22402f4aeb0Sopenharmony_ci          frame orientation and generate images accordingly if it does
22502f4aeb0Sopenharmony_ci          not match with the expected orientation.
22602f4aeb0Sopenharmony_ci
22702f4aeb0Sopenharmony_ci    EGL_PRODUCER_AUTO_ORIENTATION_NV will not be defined until a consumer
22802f4aeb0Sopenharmony_ci    and a producer are connected to the stream.  Querying it before that
22902f4aeb0Sopenharmony_ci    will generate an EGL_BAD_STATE_KHR error.
23002f4aeb0Sopenharmony_ci
23102f4aeb0Sopenharmony_ci
23202f4aeb0Sopenharmony_ciAdd to the error list in section "3.10.4.2 Querying EGLStream
23302f4aeb0Sopenharmony_ciAttributes":
23402f4aeb0Sopenharmony_ci
23502f4aeb0Sopenharmony_ci    - EGL_BAD_STATE_KHR is generated if <attribute> is any of
23602f4aeb0Sopenharmony_ci      EGL_STREAM_FRAME_ORIGIN_X_NV, EGL_STREAM_FRAME_ORIGIN_Y_NV,
23702f4aeb0Sopenharmony_ci      EGL_STREAM_FRAME_MAJOR_AXIS_NV, EGL_CONSUMER_AUTO_ORIENTATION_NV,
23802f4aeb0Sopenharmony_ci      or EGL_PRODUCER_AUTO_ORIENTATION_NV and the stream is in
23902f4aeb0Sopenharmony_ci      EGL_STREAM_STATE_CREATED_KHR or EGL_STREAM_STATE_CONNECTING_KHR
24002f4aeb0Sopenharmony_ci      state.
24102f4aeb0Sopenharmony_ci
24202f4aeb0Sopenharmony_ciIssues
24302f4aeb0Sopenharmony_ci
24402f4aeb0Sopenharmony_ci    1. Frame orientation is only needed for and relevant to specific
24502f4aeb0Sopenharmony_ci       consumers and producers.  What should the query of either
24602f4aeb0Sopenharmony_ci       EGL_STREAM_FRAME_ORIGIN_X_NV, EGL_STREAM_FRAME_ORIGIN_Y_NV,
24702f4aeb0Sopenharmony_ci       EGL_STREAM_FRAME_MAJOR_AXIS_NV when consumers or producers that do
24802f4aeb0Sopenharmony_ci       not define a frame orientation are connected to the stream?
24902f4aeb0Sopenharmony_ci
25002f4aeb0Sopenharmony_ci       RESOLVED: If the consumer or producer connected to the stream does
25102f4aeb0Sopenharmony_ci       not define a frame orientation, the queries will return
25202f4aeb0Sopenharmony_ci       EGL_DONT_CARE and applications must coordinate what they do.
25302f4aeb0Sopenharmony_ci
25402f4aeb0Sopenharmony_ci    2. What should the query return when the connected consumer or
25502f4aeb0Sopenharmony_ci       producer defines a frame orientation but can actually handle any?
25602f4aeb0Sopenharmony_ci
25702f4aeb0Sopenharmony_ci       RESOLVED: Quering EGL_STREAM_FRAME_ORIGIN_X_NV,
25802f4aeb0Sopenharmony_ci       EGL_STREAM_FRAME_ORIGIN_Y_NV, or EGL_STREAM_FRAME_MAJOR_AXIS_NV
25902f4aeb0Sopenharmony_ci       will return the default frame orientation.
26002f4aeb0Sopenharmony_ci
26102f4aeb0Sopenharmony_ci       Querying EGL_CONSUMER_AUTO_ORIENTATION_NV or
26202f4aeb0Sopenharmony_ci       EGL_PRODUCER_AUTO_ORIENTATION_NV will return whether the consumer
26302f4aeb0Sopenharmony_ci       or producer can handle any orientation automatically so that
26402f4aeb0Sopenharmony_ci       applications do not need to worry about it.
26502f4aeb0Sopenharmony_ci
26602f4aeb0Sopenharmony_ci       If querying EGL_CONSUMER_AUTO_ORIENTATION_NV or
26702f4aeb0Sopenharmony_ci       EGL_PRODUCER_AUTO_ORIENTATION_NV returns EGL_FALSE, the
26802f4aeb0Sopenharmony_ci       corresponding application is expected to query the frame
26902f4aeb0Sopenharmony_ci       orientation and take the appropriate action if that does not match
27002f4aeb0Sopenharmony_ci       the expected orientation.
27102f4aeb0Sopenharmony_ci
27202f4aeb0Sopenharmony_ciRevision History
27302f4aeb0Sopenharmony_ci
27402f4aeb0Sopenharmony_ci    #5 (May 20th, 2019) Miguel A. Vico
27502f4aeb0Sopenharmony_ci       - Allocate extension number
27602f4aeb0Sopenharmony_ci       - Mark extension as complete
27702f4aeb0Sopenharmony_ci
27802f4aeb0Sopenharmony_ci    #4 (January 30th, 2019) Miguel A. Vico
27902f4aeb0Sopenharmony_ci       - Allocate values for added enumerants
28002f4aeb0Sopenharmony_ci       - Minor fixes to the major axis attribute description
28102f4aeb0Sopenharmony_ci
28202f4aeb0Sopenharmony_ci    #3 (October 8th, 2018) Miguel A. Vico
28302f4aeb0Sopenharmony_ci       - Collapsed producer and consumer orientation attributes
28402f4aeb0Sopenharmony_ci       - Added major axis attribute to fully define orientation
28502f4aeb0Sopenharmony_ci       - Added two new attributes to indicate whether the producer or
28602f4aeb0Sopenharmony_ci         consumer can handle orientation automatically.
28702f4aeb0Sopenharmony_ci       - Rewritten issue #1
28802f4aeb0Sopenharmony_ci       - Added issue #2 and its resolution
28902f4aeb0Sopenharmony_ci       - Overall spec changes to reflect the above points
29002f4aeb0Sopenharmony_ci
29102f4aeb0Sopenharmony_ci    #2 (August 19th, 2016) Miguel A. Vico
29202f4aeb0Sopenharmony_ci       - Rename newly added attributes as consumer and producer
29302f4aeb0Sopenharmony_ci         attributes
29402f4aeb0Sopenharmony_ci       - Added both issue #1 and its resolution
29502f4aeb0Sopenharmony_ci       - Overall spec changes to reflect the above points
29602f4aeb0Sopenharmony_ci
29702f4aeb0Sopenharmony_ci    #1 (August 1st, 2016) Miguel A. Vico
29802f4aeb0Sopenharmony_ci       - Initial draft
299