etnaviv: switch to U_FIXED(..) macro
authorChristian Gmeiner <cgmeiner@igalia.com>
Thu, 27 Jul 2023 10:18:51 +0000 (12:18 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 14:10:15 +0000 (14:10 +0000)
commit8bce68edf553c079ed8451ecf24dd2831f409c25
treee2326baedb9877651d0aaeed693fd38cda20bb3b
parent16915c7a71eb8ffd1043a495bf5f88344b3854ea
etnaviv: switch to U_FIXED(..) macro

Lets have a look at trace from blob (GC3000):
    0x000b000b, /*   [10080] NTE.SAMPLER[0].SIZE := WIDTH=11,HEIGHT=11 */
    0x2001b86e, /*   [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=3.437500,HEIGHT=3.437500,ASTC=0,INT_FILTER=1,SRGB=0 */

If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x2001b86e) we can see that 0x6e is used for WIDTH and HEIGHT.

Lets have a look at an other texutre size 180x180:
    0x00b400b4, /*   [10080] NTE.SAMPLER[0].SIZE := WIDTH=180,HEIGHT=180 */
    0x2003bcef, /*   [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=7.468750,HEIGHT=7.468750,ASTC=0,INT_FILTER=1,SRGB=0 */

Lets use the same test on a different GPU that uses texture descriptors (GC7000):
    [44] SIZE: 0x000b000b WIDTH=11,HEIGHT=11
    ...
    [74] LOG_SIZE_EXT: 0x03750375 WIDTH=3.457031,HEIGHT=3.457031

If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x03750375) we can see that 0x375 is used for WIDTH and HEIGHT.

Lets have a look at an other texutre size 180x180:
    [44] SIZE: 0x00b400b4 WIDTH=180,HEIGHT=180
    ..
    [74] LOG_SIZE_EXT: 0x077d077d WIDTH=7.488281,HEIGHT=7.488281

etnaviv creates the following values for the two texture sizes:
  11 -> 0x6f
  180 -> 0xf0

Lets switch to U_FIXED(..) which results in equal values.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>
src/gallium/drivers/etnaviv/etnaviv_util.h