diff options
author | Chad Versace | 2012-05-02 14:03:31 -0500 |
---|---|---|
committer | Chad Versace | 2012-05-21 16:39:41 -0500 |
commit | 652fe8d9dd2393127b11741ba63cb95a83ad454f (patch) | |
tree | e3e6b87fee1d0bb04fe5575b2d57c248472fd933 | |
parent | 428688d1eaa3d0faa13a61613cdaeaabcb351f0e (diff) | |
download | dri2proto-652fe8d9dd2393127b11741ba63cb95a83ad454f.tar.gz dri2proto-652fe8d9dd2393127b11741ba63cb95a83ad454f.tar.xz dri2proto-652fe8d9dd2393127b11741ba63cb95a83ad454f.zip |
dri2proto: Add DRI2GetParam request
Bump protocol version to 1.4.
Bump package version to 2.7.
This new protocol request effectively allows clients to perform feature
detection on the DDX.
If I had DRI2GetParam in June 2011, when I was implementing support in the
Intel DDX and Mesa for new hardware that required a new DRI2 attachment
format, then I could have avoided a week of pain caused by the necessity
to write a horrid feature detection hack [1] in Mesa. In the future, when
the work begins to add MSAA support to the Intel DDX, having a clean way
to do feature detection will allow us to avoid revisiting and expanding
that hack.
[1] mesa, commit aea2236a, function intel_verify_dri2_has_hi
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | dri2proto.h | 28 | ||||
-rw-r--r-- | dri2proto.txt | 49 |
3 files changed, 76 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index d671f5a..aeb86a9 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,5 +1,5 @@ | |||
1 | AC_PREREQ([2.60]) | 1 | AC_PREREQ([2.60]) |
2 | AC_INIT([DRI2Proto], [2.6], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) | 2 | AC_INIT([DRI2Proto], [2.7], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) |
3 | AM_INIT_AUTOMAKE([foreign dist-bzip2]) | 3 | AM_INIT_AUTOMAKE([foreign dist-bzip2]) |
4 | AM_MAINTAINER_MODE | 4 | AM_MAINTAINER_MODE |
5 | 5 | ||
diff --git a/dri2proto.h b/dri2proto.h index cd82afb..128b807 100644 --- a/dri2proto.h +++ b/dri2proto.h | |||
@@ -35,11 +35,11 @@ | |||
35 | 35 | ||
36 | #define DRI2_NAME "DRI2" | 36 | #define DRI2_NAME "DRI2" |
37 | #define DRI2_MAJOR 1 | 37 | #define DRI2_MAJOR 1 |
38 | #define DRI2_MINOR 3 | 38 | #define DRI2_MINOR 4 |
39 | 39 | ||
40 | #define DRI2NumberErrors 0 | 40 | #define DRI2NumberErrors 0 |
41 | #define DRI2NumberEvents 2 | 41 | #define DRI2NumberEvents 2 |
42 | #define DRI2NumberRequests 13 | 42 | #define DRI2NumberRequests 14 |
43 | 43 | ||
44 | #define X_DRI2QueryVersion 0 | 44 | #define X_DRI2QueryVersion 0 |
45 | #define X_DRI2Connect 1 | 45 | #define X_DRI2Connect 1 |
@@ -54,6 +54,7 @@ | |||
54 | #define X_DRI2WaitMSC 10 | 54 | #define X_DRI2WaitMSC 10 |
55 | #define X_DRI2WaitSBC 11 | 55 | #define X_DRI2WaitSBC 11 |
56 | #define X_DRI2SwapInterval 12 | 56 | #define X_DRI2SwapInterval 12 |
57 | #define X_DRI2GetParam 13 | ||
57 | 58 | ||
58 | /* | 59 | /* |
59 | * Events | 60 | * Events |
@@ -330,4 +331,27 @@ typedef struct { | |||
330 | } xDRI2InvalidateBuffers; | 331 | } xDRI2InvalidateBuffers; |
331 | #define sz_xDRI2InvalidateBuffers 32 | 332 | #define sz_xDRI2InvalidateBuffers 32 |
332 | 333 | ||
334 | typedef struct { | ||
335 | CARD8 reqType; | ||
336 | CARD8 dri2ReqType; | ||
337 | CARD16 length B16; | ||
338 | CARD32 drawable B32; | ||
339 | CARD32 param B32; | ||
340 | } xDRI2GetParamReq; | ||
341 | #define sz_xDRI2GetParamReq 12 | ||
342 | |||
343 | typedef struct { | ||
344 | BYTE type; /*X_Reply*/ | ||
345 | BOOL is_param_recognized; | ||
346 | CARD16 sequenceNumber B16; | ||
347 | CARD32 length B32; | ||
348 | CARD32 value_hi B32; | ||
349 | CARD32 value_lo B32; | ||
350 | CARD32 pad1 B32; | ||
351 | CARD32 pad2 B32; | ||
352 | CARD32 pad3 B32; | ||
353 | CARD32 pad4 B32; | ||
354 | } xDRI2GetParamReply; | ||
355 | #define sz_xDRI2GetParamReply 32 | ||
356 | |||
333 | #endif | 357 | #endif |
diff --git a/dri2proto.txt b/dri2proto.txt index 7bde067..9921301 100644 --- a/dri2proto.txt +++ b/dri2proto.txt | |||
@@ -440,6 +440,36 @@ The name of this extension is "DRI2". | |||
440 | DRI2SwapBuffers requests to swap at most once per interval frames, | 440 | DRI2SwapBuffers requests to swap at most once per interval frames, |
441 | which is useful useful for limiting the frame rate. | 441 | which is useful useful for limiting the frame rate. |
442 | 442 | ||
443 | ┌─── | ||
444 | DRI2GetParam | ||
445 | drawable: DRAWABLE | ||
446 | param: CARD32 | ||
447 | ▶ | ||
448 | is_param_recognized: BOOL | ||
449 | value: CARD64 | ||
450 | └─── | ||
451 | Errors: Drawable | ||
452 | |||
453 | Get the value of a parameter. The parameter's value is looked up on | ||
454 | the screen associated with 'drawable'. | ||
455 | |||
456 | Parameter names in which the value of the most significant byte is | ||
457 | 0 are reserved for the X server. Currently, no such parameter names | ||
458 | are defined. (When any such names are defined, they will be defined in | ||
459 | this extension specification and its associated headers). | ||
460 | |||
461 | Parameter names in which the byte's value is 1 are reserved for the | ||
462 | DDX. Such names are private to each driver and shall be defined in the | ||
463 | respective driver's headers. | ||
464 | |||
465 | Parameter names in which the byte's value is neither 0 nor 1 are | ||
466 | reserved for future use. | ||
467 | |||
468 | Possible values of 'is_param_recognized' are true (1) and false (0). | ||
469 | If false, then 'value' is undefined. | ||
470 | |||
471 | This request is only available with protocol version 1.4 or later. | ||
472 | |||
443 | ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ | 473 | ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ |
444 | 474 | ||
445 | 9. Extension Events | 475 | 9. Extension Events |
@@ -512,6 +542,8 @@ The DRI2 extension has undergone a number of revisions before | |||
512 | 542 | ||
513 | 2.6: Enlightenment attained. Added the DRI2BufferHiz attachment. | 543 | 2.6: Enlightenment attained. Added the DRI2BufferHiz attachment. |
514 | 544 | ||
545 | 2.7: Added the DRI2GetParam request. | ||
546 | |||
515 | Compatibility up to 2.0 is not preserved, but was also never released. | 547 | Compatibility up to 2.0 is not preserved, but was also never released. |
516 | 548 | ||
517 | 549 | ||
@@ -830,6 +862,23 @@ A.2 Protocol Requests | |||
830 | ▶ | 862 | ▶ |
831 | └─── | 863 | └─── |
832 | 864 | ||
865 | ┌─── | ||
866 | DRI2GetParam | ||
867 | 1 CARD8 major opcode | ||
868 | 1 13 DRI2 opcode | ||
869 | 2 8 length | ||
870 | 4 DRAWABLE drawable | ||
871 | 4 CARD32 param | ||
872 | ▶ | ||
873 | 1 1 Reply | ||
874 | 1 BOOL is_param_recognized | ||
875 | 2 CARD16 sequence number | ||
876 | 4 0 reply length | ||
877 | 4 CARD32 value_hi | ||
878 | 4 CARD32 value_lo | ||
879 | 16 unused | ||
880 | └─── | ||
881 | |||
833 | A.3 Protocol Events | 882 | A.3 Protocol Events |
834 | 883 | ||
835 | The DRI2 extension specifies DRI2_BufferSwapComplete and | 884 | The DRI2 extension specifies DRI2_BufferSwapComplete and |