Skip to content

Commit

Permalink
Add GFX 10.7 capsets
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed May 24, 2022
1 parent 6ea15d3 commit 9190472
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
19 changes: 13 additions & 6 deletions channels/rdpgfx/client/rdpgfx_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,10 @@ static UINT rdpgfx_send_caps_advertise_pdu(RdpgfxClientContext* context,
static BOOL rdpgfx_is_capability_filtered(RDPGFX_PLUGIN* gfx, UINT32 caps)
{
const UINT32 filter = gfx->capsFilter;
const UINT32 capList[] = {
RDPGFX_CAPVERSION_8, RDPGFX_CAPVERSION_81, RDPGFX_CAPVERSION_10,
RDPGFX_CAPVERSION_101, RDPGFX_CAPVERSION_102, RDPGFX_CAPVERSION_103,
RDPGFX_CAPVERSION_104, RDPGFX_CAPVERSION_105, RDPGFX_CAPVERSION_106
};
const UINT32 capList[] = { RDPGFX_CAPVERSION_8, RDPGFX_CAPVERSION_81, RDPGFX_CAPVERSION_10,
RDPGFX_CAPVERSION_101, RDPGFX_CAPVERSION_102, RDPGFX_CAPVERSION_103,
RDPGFX_CAPVERSION_104, RDPGFX_CAPVERSION_105, RDPGFX_CAPVERSION_106,
RDPGFX_CAPVERSION_107 };
UINT32 x;

for (x = 0; x < ARRAYSIZE(capList); x++)
Expand All @@ -188,7 +187,7 @@ static UINT rdpgfx_send_supported_caps(RDPGFX_CHANNEL_CALLBACK* callback)
RdpgfxClientContext* context;
RDPGFX_CAPSET* capsSet;
RDPGFX_CAPSET capsSets[RDPGFX_NUMBER_CAPSETS] = { 0 };
RDPGFX_CAPS_ADVERTISE_PDU pdu;
RDPGFX_CAPS_ADVERTISE_PDU pdu = { 0 };

if (!callback)
return ERROR_BAD_ARGUMENTS;
Expand Down Expand Up @@ -321,6 +320,14 @@ static UINT rdpgfx_send_supported_caps(RDPGFX_CHANNEL_CALLBACK* callback)
capsSet->length = 0x4;
capsSet->flags = caps10Flags;
}

if (!rdpgfx_is_capability_filtered(gfx, RDPGFX_CAPVERSION_107))
{
capsSet = &capsSets[pdu.capsSetCount++];
capsSet->version = RDPGFX_CAPVERSION_107;
capsSet->length = 0x4;
capsSet->flags = caps10Flags;
}
}

return IFCALLRESULT(ERROR_BAD_CONFIGURATION, context->CapsAdvertise, context, &pdu);
Expand Down
4 changes: 3 additions & 1 deletion include/freerdp/channels/rdpgfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ typedef struct
#define RDPGFX_CAPVERSION_104 0x000A0400 /** [MS-RDPEGFX] 2.2.3.7 */
#define RDPGFX_CAPVERSION_105 0x000A0502 /** [MS-RDPEGFX] 2.2.3.8 */
#define RDPGFX_CAPVERSION_106 0x000A0601 /** [MS-RDPEGFX] 2.2.3.9 */
#define RDPGFX_CAPVERSION_107 0x000A0701 /** [MS-RDPEGFX] 2.2.3.10 */

#define RDPGFX_NUMBER_CAPSETS 9
#define RDPGFX_NUMBER_CAPSETS 10
#define RDPGFX_CAPSET_BASE_SIZE 8

typedef struct
Expand All @@ -113,6 +114,7 @@ typedef struct
#define RDPGFX_CAPS_FLAG_AVC420_ENABLED 0x00000010U /* 8.1+ */
#define RDPGFX_CAPS_FLAG_AVC_DISABLED 0x00000020U /* 10.0+ */
#define RDPGFX_CAPS_FLAG_AVC_THINCLIENT 0x00000040U /* 10.3+ */
#define RDPGFX_CAPS_FLAG_SCALEDMAP_DISABLE 0x00000080U /* 10.7+ */

typedef struct
{
Expand Down
13 changes: 8 additions & 5 deletions server/shadow/shadow_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,10 @@ shadow_client_rdpgfx_frame_acknowledge(RdpgfxServerContext* context,
static BOOL shadow_are_caps_filtered(const rdpSettings* settings, UINT32 caps)
{
UINT32 filter;
const UINT32 capList[] = {
RDPGFX_CAPVERSION_8, RDPGFX_CAPVERSION_81, RDPGFX_CAPVERSION_10,
RDPGFX_CAPVERSION_101, RDPGFX_CAPVERSION_102, RDPGFX_CAPVERSION_103,
RDPGFX_CAPVERSION_104, RDPGFX_CAPVERSION_105, RDPGFX_CAPVERSION_106
};
const UINT32 capList[] = { RDPGFX_CAPVERSION_8, RDPGFX_CAPVERSION_81, RDPGFX_CAPVERSION_10,
RDPGFX_CAPVERSION_101, RDPGFX_CAPVERSION_102, RDPGFX_CAPVERSION_103,
RDPGFX_CAPVERSION_104, RDPGFX_CAPVERSION_105, RDPGFX_CAPVERSION_106,
RDPGFX_CAPVERSION_107 };
UINT32 x;

WINPR_ASSERT(settings);
Expand Down Expand Up @@ -871,6 +870,10 @@ static UINT shadow_client_rdpgfx_caps_advertise(RdpgfxServerContext* context,
if (!shadow_client_refresh_rect(&client->context, 0, NULL))
return rc;

if (shadow_client_caps_test_version(context, client, h264, capsAdvertise->capsSets,
capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_107, &rc))
return rc;

if (shadow_client_caps_test_version(context, client, h264, capsAdvertise->capsSets,
capsAdvertise->capsSetCount, RDPGFX_CAPVERSION_106, &rc))
return rc;
Expand Down

0 comments on commit 9190472

Please sign in to comment.