What is the purpose of a bitrate of 0

I am considering open source AMD GPU drivers for Linux. I noticed something that I had not seen before, and would like to know the purpose. There are a number of definitions on line 1441 of the sid.h file, which are integers that are left-shifted to 0. If this did not cause the initial integer to work?

Here is an excerpt and a link to the head

    #define VGT_EVENT_INITIATOR                      0xA2A4
    #define SAMPLE_STREAMOUTSTATS1                   (1 << 0)
    #define SAMPLE_STREAMOUTSTATS2                   (2 << 0)
    #define SAMPLE_STREAMOUTSTATS3                   (3 << 0)

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdgpu/sid.h#L1441

In addition, I am examining access to the AMD GPU performance counter registries to calculate the load on the GPU. Any advice on this would also be appreciated.

+4
source share
1 answer

( ). ,

#define FLAG_1 0x01
#define FLAG_2 0x02
#define FLAG_3 0x04
#define FLAG_4 0x08

#define FLAG_1 (1u << 0)
#define FLAG_2 (1u << 1)
#define FLAG_3 (1u << 2)
#define FLAG_4 (1u << 3)

0. , FLAG_1 , . 0 , - .

, 0 DYN_OR_EN DYN_RR_EN.


, ()

// Bits 0-3 - lower counter, bits 4-7 - upper counter

#define LOWER_0  (0u << 0)
#define LOWER_1  (1u << 0)
#define LOWER_2  (2u << 0)
#define LOWER_3  (3u << 0)

#define UPPER_0  (0u << 4)
#define UPPER_1  (1u << 4)
#define UPPER_2  (2u << 4)
#define UPPER_3  (3u << 4)

unsigned packed_counters = LOWER_2 + UPPER_3; /* or `LOWER_2 | UPPER_3` */

, 0 . 0.

0 LC_XMIT_N_FTS LC_XMIT_N_FTS_MASK.

+10

Source: https://habr.com/ru/post/1691705/


All Articles