diff options
author | Christoph Bumiller <[email protected]> | 2013-03-30 21:28:30 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2013-04-03 12:54:43 +0200 |
commit | d801545964f8183bb17ed913b7c19482dad43b6c (patch) | |
tree | 9dd902276999996d4eeb587fe6d99f7565e7ff30 /src/gallium/drivers/nv50/nv50_blit.h | |
parent | 6417d56c1921c311a7b59001e0d37822a0ed1a65 (diff) |
nvc0: fix for 2d engine R source formats writing RRR1 and not R001
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_blit.h')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_blit.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_blit.h b/src/gallium/drivers/nv50/nv50_blit.h index d409f21f615..bdd6a63d1f1 100644 --- a/src/gallium/drivers/nv50/nv50_blit.h +++ b/src/gallium/drivers/nv50/nv50_blit.h @@ -180,4 +180,44 @@ nv50_blit_eng2d_get_mask(const struct pipe_blit_info *info) return mask; } +#if NOUVEAU_DRIVER == 0xc0 +# define nv50_format_table nvc0_format_table +#endif + +/* return TRUE for formats that can be converted among each other by NVC0_2D */ +static INLINE boolean +nv50_2d_dst_format_faithful(enum pipe_format format) +{ + const uint64_t mask = + NV50_ENG2D_SUPPORTED_FORMATS & + ~NV50_ENG2D_NOCONVERT_FORMATS; + uint8_t id = nv50_format_table[format].rt; + return (id >= 0xc0) && (mask & (1ULL << (id - 0xc0))); +} +static INLINE boolean +nv50_2d_src_format_faithful(enum pipe_format format) +{ + const uint64_t mask = + NV50_ENG2D_SUPPORTED_FORMATS & + ~(NV50_ENG2D_LUMINANCE_FORMATS | NV50_ENG2D_INTENSITY_FORMATS); + uint8_t id = nv50_format_table[format].rt; + return (id >= 0xc0) && (mask & (1ULL << (id - 0xc0))); +} + +static INLINE boolean +nv50_2d_format_supported(enum pipe_format format) +{ + uint8_t id = nv50_format_table[format].rt; + return (id >= 0xc0) && + (NV50_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0))); +} + +static INLINE boolean +nv50_2d_dst_format_ops_supported(enum pipe_format format) +{ + uint8_t id = nv50_format_table[format].rt; + return (id >= 0xc0) && + (NV50_ENG2D_OPERATION_FORMATS & (1ULL << (id - 0xc0))); +} + #endif /* __NV50_BLIT_H__ */ |