diff options
author | Charmaine Lee <[email protected]> | 2014-08-12 07:37:12 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2014-08-12 08:03:24 -0600 |
commit | 0c065270c0ff063edba03516b22d734023cac912 (patch) | |
tree | 33a6cf749f9a93cf1f24c3c9c747f659d28c3e97 /src/gallium/drivers/svga/include | |
parent | d839be24b3b53717fcc153c3d00afb1c516d926e (diff) |
svga: Add a limit to the maximum surface size
This patch adds a limit to the maximum surface size which is
based on the maximum size of a single mob. If this value is not
available, the maximum surface size is by default set to 128 MB.
Reviewed-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/include')
-rw-r--r-- | src/gallium/drivers/svga/include/svga3d_surfacedefs.h | 5 | ||||
-rw-r--r-- | src/gallium/drivers/svga/include/svga_reg.h | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/include/svga3d_surfacedefs.h b/src/gallium/drivers/svga/include/svga3d_surfacedefs.h index 9afdd46ac67..8763cdf319e 100644 --- a/src/gallium/drivers/svga/include/svga3d_surfacedefs.h +++ b/src/gallium/drivers/svga/include/svga3d_surfacedefs.h @@ -872,7 +872,7 @@ svga3dsurface_get_serialized_size(SVGA3dSurfaceFormat format, bool cubemap) { const struct svga3d_surface_desc *desc = svga3dsurface_get_desc(format); - uint32 total_size = 0; + uint64_t total_size = 0; uint32 mip; for (mip = 0; mip < num_mip_levels; mip++) { @@ -885,7 +885,8 @@ svga3dsurface_get_serialized_size(SVGA3dSurfaceFormat format, if (cubemap) total_size *= SVGA3D_MAX_SURFACE_FACES; - return total_size; + return (total_size > (uint64_t) MAX_UINT32) ? MAX_UINT32 : + (uint32) total_size; } diff --git a/src/gallium/drivers/svga/include/svga_reg.h b/src/gallium/drivers/svga/include/svga_reg.h index 3ba010efbc6..e75b442f994 100644 --- a/src/gallium/drivers/svga/include/svga_reg.h +++ b/src/gallium/drivers/svga/include/svga_reg.h @@ -180,7 +180,15 @@ enum { SVGA_REG_MEMORY_SIZE = 47, /* Total dedicated device memory excluding FIFO */ SVGA_REG_COMMAND_LOW = 48, /* Lower 32 bits and submits commands */ SVGA_REG_COMMAND_HIGH = 49, /* Upper 32 bits of command buffer PA */ - SVGA_REG_TOP = 50, /* Must be 1 more than the last register */ + SVGA_REG_MAX_PRIMARY_BOUNDING_BOX_MEM = 50, /* Max primary memory */ + SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB = 51, /* Suggested limit on mob mem */ + SVGA_REG_DEV_CAP = 52, /* Write dev cap index, read value */ + SVGA_REG_CMD_PREPEND_LOW = 53, + SVGA_REG_iCMD_PREPEND_HIGH = 54, + SVGA_REG_SCREENTARGET_MAX_WIDTH = 55, + SVGA_REG_SCREENTARGET_MAX_HEIGHT = 56, + SVGA_REG_MOB_MAX_SIZE = 57, + SVGA_REG_TOP = 58, /* Must be 1 more than the last register */ SVGA_PALETTE_BASE = 1024, /* Base of SVGA color map */ /* Next 768 (== 256*3) registers exist for colormap */ |