Lines Matching full:metadata

45  * @srf:            The surface metadata.
196 return srf->metadata.num_sizes * sizeof(struct vmw_surface_dma); in vmw_surface_dma_size()
210 return sizeof(struct vmw_surface_define) + srf->metadata.num_sizes * in vmw_surface_define_size()
259 cmd_len = sizeof(cmd->body) + srf->metadata.num_sizes * in vmw_surface_define_encode()
270 cmd->body.surfaceFlags = (SVGA3dSurface1Flags)srf->metadata.flags; in vmw_surface_define_encode()
271 cmd->body.format = srf->metadata.format; in vmw_surface_define_encode()
273 cmd->body.face[i].numMipLevels = srf->metadata.mip_levels[i]; in vmw_surface_define_encode()
277 src_size = srf->metadata.sizes; in vmw_surface_define_encode()
279 for (i = 0; i < srf->metadata.num_sizes; ++i, cmd_size++, src_size++) { in vmw_surface_define_encode()
303 vmw_surface_get_desc(srf->metadata.format); in vmw_surface_dma_encode()
305 for (i = 0; i < srf->metadata.num_sizes; ++i) { in vmw_surface_dma_encode()
311 const struct drm_vmw_size *cur_size = &srf->metadata.sizes[i]; in vmw_surface_dma_encode()
665 kfree(srf->metadata.sizes); in vmw_user_surface_free()
729 struct vmw_surface_metadata *metadata; in vmw_surface_define_ioctl() local
770 metadata = &srf->metadata; in vmw_surface_define_ioctl()
774 metadata->flags = (SVGA3dSurfaceAllFlags)req->flags; in vmw_surface_define_ioctl()
775 metadata->format = req->format; in vmw_surface_define_ioctl()
776 metadata->scanout = req->scanout; in vmw_surface_define_ioctl()
778 memcpy(metadata->mip_levels, req->mip_levels, in vmw_surface_define_ioctl()
779 sizeof(metadata->mip_levels)); in vmw_surface_define_ioctl()
780 metadata->num_sizes = num_sizes; in vmw_surface_define_ioctl()
781 metadata->sizes = in vmw_surface_define_ioctl()
784 metadata->num_sizes, sizeof(*metadata->sizes)); in vmw_surface_define_ioctl()
785 if (IS_ERR(metadata->sizes)) { in vmw_surface_define_ioctl()
786 ret = PTR_ERR(metadata->sizes); in vmw_surface_define_ioctl()
789 srf->offsets = kmalloc_array(metadata->num_sizes, sizeof(*srf->offsets), in vmw_surface_define_ioctl()
796 metadata->base_size = *srf->metadata.sizes; in vmw_surface_define_ioctl()
797 metadata->autogen_filter = SVGA3D_TEX_FILTER_NONE; in vmw_surface_define_ioctl()
798 metadata->multisample_count = 0; in vmw_surface_define_ioctl()
799 metadata->multisample_pattern = SVGA3D_MS_PATTERN_NONE; in vmw_surface_define_ioctl()
800 metadata->quality_level = SVGA3D_MS_QUALITY_NONE; in vmw_surface_define_ioctl()
804 cur_size = metadata->sizes; in vmw_surface_define_ioctl()
807 for (j = 0; j < metadata->mip_levels[i]; ++j) { in vmw_surface_define_ioctl()
822 metadata->scanout && in vmw_surface_define_ioctl()
823 metadata->num_sizes == 1 && in vmw_surface_define_ioctl()
824 metadata->sizes[0].width == VMW_CURSOR_SNOOP_WIDTH && in vmw_surface_define_ioctl()
825 metadata->sizes[0].height == VMW_CURSOR_SNOOP_HEIGHT && in vmw_surface_define_ioctl()
826 metadata->format == VMW_CURSOR_SNOOP_FORMAT) { in vmw_surface_define_ioctl()
896 kfree(metadata->sizes); in vmw_surface_define_ioctl()
1122 rep->flags = (uint32_t)srf->metadata.flags; in vmw_surface_reference_ioctl()
1123 rep->format = srf->metadata.format; in vmw_surface_reference_ioctl()
1124 memcpy(rep->mip_levels, srf->metadata.mip_levels, in vmw_surface_reference_ioctl()
1125 sizeof(srf->metadata.mip_levels)); in vmw_surface_reference_ioctl()
1130 ret = copy_to_user(user_sizes, &srf->metadata.base_size, in vmw_surface_reference_ioctl()
1131 sizeof(srf->metadata.base_size)); in vmw_surface_reference_ioctl()
1134 srf->metadata.num_sizes); in vmw_surface_reference_ioctl()
1154 struct vmw_surface_metadata *metadata = &srf->metadata; in vmw_gb_surface_create() local
1189 if (has_sm5_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1193 } else if (has_sm4_1_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1197 } else if (metadata->array_size > 0) { in vmw_gb_surface_create()
1217 if (has_sm5_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1221 cmd4->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1222 cmd4->body.format = metadata->format; in vmw_gb_surface_create()
1223 cmd4->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1224 cmd4->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1225 cmd4->body.multisamplePattern = metadata->multisample_pattern; in vmw_gb_surface_create()
1226 cmd4->body.qualityLevel = metadata->quality_level; in vmw_gb_surface_create()
1227 cmd4->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1228 cmd4->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1229 cmd4->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1230 cmd4->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1231 cmd4->body.arraySize = metadata->array_size; in vmw_gb_surface_create()
1232 cmd4->body.bufferByteStride = metadata->buffer_byte_stride; in vmw_gb_surface_create()
1233 } else if (has_sm4_1_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1237 cmd3->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1238 cmd3->body.format = metadata->format; in vmw_gb_surface_create()
1239 cmd3->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1240 cmd3->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1241 cmd3->body.multisamplePattern = metadata->multisample_pattern; in vmw_gb_surface_create()
1242 cmd3->body.qualityLevel = metadata->quality_level; in vmw_gb_surface_create()
1243 cmd3->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1244 cmd3->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1245 cmd3->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1246 cmd3->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1247 cmd3->body.arraySize = metadata->array_size; in vmw_gb_surface_create()
1248 } else if (metadata->array_size > 0) { in vmw_gb_surface_create()
1252 cmd2->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1253 cmd2->body.format = metadata->format; in vmw_gb_surface_create()
1254 cmd2->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1255 cmd2->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1256 cmd2->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1257 cmd2->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1258 cmd2->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1259 cmd2->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1260 cmd2->body.arraySize = metadata->array_size; in vmw_gb_surface_create()
1265 cmd->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1266 cmd->body.format = metadata->format; in vmw_gb_surface_create()
1267 cmd->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1268 cmd->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1269 cmd->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1270 cmd->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1271 cmd->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1272 cmd->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1544 struct vmw_surface_metadata metadata = {0}; in vmw_gb_surface_define_internal() local
1595 metadata.flags = svga3d_flags_64; in vmw_gb_surface_define_internal()
1596 metadata.format = req->base.format; in vmw_gb_surface_define_internal()
1597 metadata.mip_levels[0] = req->base.mip_levels; in vmw_gb_surface_define_internal()
1598 metadata.multisample_count = req->base.multisample_count; in vmw_gb_surface_define_internal()
1599 metadata.multisample_pattern = req->multisample_pattern; in vmw_gb_surface_define_internal()
1600 metadata.quality_level = req->quality_level; in vmw_gb_surface_define_internal()
1601 metadata.array_size = req->base.array_size; in vmw_gb_surface_define_internal()
1602 metadata.buffer_byte_stride = req->buffer_byte_stride; in vmw_gb_surface_define_internal()
1603 metadata.num_sizes = 1; in vmw_gb_surface_define_internal()
1604 metadata.base_size = req->base.base_size; in vmw_gb_surface_define_internal()
1605 metadata.scanout = req->base.drm_surface_flags & in vmw_gb_surface_define_internal()
1609 ret = vmw_gb_surface_define(dev_priv, &metadata, &srf); in vmw_gb_surface_define_internal()
1721 struct vmw_surface_metadata *metadata; in vmw_gb_surface_reference_internal() local
1737 metadata = &srf->metadata; in vmw_gb_surface_reference_internal()
1749 rep->creq.base.svga3d_flags = SVGA3D_FLAGS_LOWER_32(metadata->flags); in vmw_gb_surface_reference_internal()
1750 rep->creq.base.format = metadata->format; in vmw_gb_surface_reference_internal()
1751 rep->creq.base.mip_levels = metadata->mip_levels[0]; in vmw_gb_surface_reference_internal()
1753 rep->creq.base.multisample_count = metadata->multisample_count; in vmw_gb_surface_reference_internal()
1754 rep->creq.base.autogen_filter = metadata->autogen_filter; in vmw_gb_surface_reference_internal()
1755 rep->creq.base.array_size = metadata->array_size; in vmw_gb_surface_reference_internal()
1757 rep->creq.base.base_size = metadata->base_size; in vmw_gb_surface_reference_internal()
1767 SVGA3D_FLAGS_UPPER_32(metadata->flags); in vmw_gb_surface_reference_internal()
1768 rep->creq.multisample_pattern = metadata->multisample_pattern; in vmw_gb_surface_reference_internal()
1769 rep->creq.quality_level = metadata->quality_level; in vmw_gb_surface_reference_internal()
1940 if (srf->metadata.format == SVGA3D_BUFFER) in vmw_surface_dirty_range_add()
2029 const struct vmw_surface_metadata *metadata = &srf->metadata; in vmw_surface_dirty_alloc() local
2038 if (metadata->array_size) in vmw_surface_dirty_alloc()
2039 num_layers = metadata->array_size; in vmw_surface_dirty_alloc()
2040 else if (metadata->flags & SVGA3D_SURFACE_CUBEMAP) in vmw_surface_dirty_alloc()
2043 num_mip = metadata->mip_levels[0]; in vmw_surface_dirty_alloc()
2056 num_samples = max_t(u32, 1, metadata->multisample_count); in vmw_surface_dirty_alloc()
2057 ret = vmw_surface_setup_cache(&metadata->base_size, metadata->format, in vmw_surface_dirty_alloc()
2115 * @metadata: Metadata representing the surface to create.
2127 struct vmw_surface_metadata *metadata; in vmw_gb_surface_define() local
2179 srf->metadata = *req; in vmw_gb_surface_define()
2182 metadata = &srf->metadata; in vmw_gb_surface_define()
2184 if (metadata->array_size) in vmw_gb_surface_define()
2186 else if (metadata->flags & SVGA3D_SURFACE_CUBEMAP) in vmw_gb_surface_define()
2189 if (metadata->flags & SVGA3D_SURFACE_MULTISAMPLE) in vmw_gb_surface_define()
2190 sample_count = metadata->multisample_count; in vmw_gb_surface_define()
2194 metadata->format, in vmw_gb_surface_define()
2195 metadata->base_size, in vmw_gb_surface_define()
2196 metadata->mip_levels[0], in vmw_gb_surface_define()
2200 if (metadata->flags & SVGA3D_SURFACE_BIND_STREAM_OUTPUT) in vmw_gb_surface_define()
2212 metadata->scanout && in vmw_gb_surface_define()
2213 metadata->base_size.width <= dev_priv->stdu_max_width && in vmw_gb_surface_define()
2214 metadata->base_size.height <= dev_priv->stdu_max_height) in vmw_gb_surface_define()
2215 metadata->flags |= SVGA3D_SURFACE_SCREENTARGET; in vmw_gb_surface_define()