Lines Matching refs:metadata
205 return srf->metadata.num_sizes * sizeof(struct vmw_surface_dma); in vmw_surface_dma_size()
219 return sizeof(struct vmw_surface_define) + srf->metadata.num_sizes * in vmw_surface_define_size()
268 cmd_len = sizeof(cmd->body) + srf->metadata.num_sizes * in vmw_surface_define_encode()
279 cmd->body.surfaceFlags = (SVGA3dSurface1Flags)srf->metadata.flags; in vmw_surface_define_encode()
280 cmd->body.format = srf->metadata.format; in vmw_surface_define_encode()
282 cmd->body.face[i].numMipLevels = srf->metadata.mip_levels[i]; in vmw_surface_define_encode()
286 src_size = srf->metadata.sizes; in vmw_surface_define_encode()
288 for (i = 0; i < srf->metadata.num_sizes; ++i, cmd_size++, src_size++) { in vmw_surface_define_encode()
312 vmw_surface_get_desc(srf->metadata.format); in vmw_surface_dma_encode()
314 for (i = 0; i < srf->metadata.num_sizes; ++i) { in vmw_surface_dma_encode()
320 const struct drm_vmw_size *cur_size = &srf->metadata.sizes[i]; in vmw_surface_dma_encode()
676 kfree(srf->metadata.sizes); in vmw_user_surface_free()
735 struct vmw_surface_metadata *metadata; in vmw_surface_define_ioctl() local
797 metadata = &srf->metadata; in vmw_surface_define_ioctl()
801 metadata->flags = (SVGA3dSurfaceAllFlags)req->flags; in vmw_surface_define_ioctl()
802 metadata->format = req->format; in vmw_surface_define_ioctl()
803 metadata->scanout = req->scanout; in vmw_surface_define_ioctl()
805 memcpy(metadata->mip_levels, req->mip_levels, in vmw_surface_define_ioctl()
806 sizeof(metadata->mip_levels)); in vmw_surface_define_ioctl()
807 metadata->num_sizes = num_sizes; in vmw_surface_define_ioctl()
809 metadata->sizes = in vmw_surface_define_ioctl()
812 sizeof(*metadata->sizes) * metadata->num_sizes); in vmw_surface_define_ioctl()
813 if (IS_ERR(metadata->sizes)) { in vmw_surface_define_ioctl()
814 ret = PTR_ERR(metadata->sizes); in vmw_surface_define_ioctl()
817 srf->offsets = kmalloc_array(metadata->num_sizes, sizeof(*srf->offsets), in vmw_surface_define_ioctl()
824 metadata->base_size = *srf->metadata.sizes; in vmw_surface_define_ioctl()
825 metadata->autogen_filter = SVGA3D_TEX_FILTER_NONE; in vmw_surface_define_ioctl()
826 metadata->multisample_count = 0; in vmw_surface_define_ioctl()
827 metadata->multisample_pattern = SVGA3D_MS_PATTERN_NONE; in vmw_surface_define_ioctl()
828 metadata->quality_level = SVGA3D_MS_QUALITY_NONE; in vmw_surface_define_ioctl()
832 cur_size = metadata->sizes; in vmw_surface_define_ioctl()
835 for (j = 0; j < metadata->mip_levels[i]; ++j) { in vmw_surface_define_ioctl()
849 if (metadata->scanout && in vmw_surface_define_ioctl()
850 metadata->num_sizes == 1 && in vmw_surface_define_ioctl()
851 metadata->sizes[0].width == 64 && in vmw_surface_define_ioctl()
852 metadata->sizes[0].height == 64 && in vmw_surface_define_ioctl()
853 metadata->format == SVGA3D_A8R8G8B8) { in vmw_surface_define_ioctl()
916 kfree(metadata->sizes); in vmw_surface_define_ioctl()
1035 rep->flags = (uint32_t)srf->metadata.flags; in vmw_surface_reference_ioctl()
1036 rep->format = srf->metadata.format; in vmw_surface_reference_ioctl()
1037 memcpy(rep->mip_levels, srf->metadata.mip_levels, in vmw_surface_reference_ioctl()
1038 sizeof(srf->metadata.mip_levels)); in vmw_surface_reference_ioctl()
1043 ret = copy_to_user(user_sizes, &srf->metadata.base_size, in vmw_surface_reference_ioctl()
1044 sizeof(srf->metadata.base_size)); in vmw_surface_reference_ioctl()
1047 srf->metadata.num_sizes); in vmw_surface_reference_ioctl()
1067 struct vmw_surface_metadata *metadata = &srf->metadata; in vmw_gb_surface_create() local
1102 if (has_sm5_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1106 } else if (has_sm4_1_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1110 } else if (metadata->array_size > 0) { in vmw_gb_surface_create()
1130 if (has_sm5_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1134 cmd4->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1135 cmd4->body.format = metadata->format; in vmw_gb_surface_create()
1136 cmd4->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1137 cmd4->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1138 cmd4->body.multisamplePattern = metadata->multisample_pattern; in vmw_gb_surface_create()
1139 cmd4->body.qualityLevel = metadata->quality_level; in vmw_gb_surface_create()
1140 cmd4->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1141 cmd4->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1142 cmd4->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1143 cmd4->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1144 cmd4->body.arraySize = metadata->array_size; in vmw_gb_surface_create()
1145 cmd4->body.bufferByteStride = metadata->buffer_byte_stride; in vmw_gb_surface_create()
1146 } else if (has_sm4_1_context(dev_priv) && metadata->array_size > 0) { in vmw_gb_surface_create()
1150 cmd3->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1151 cmd3->body.format = metadata->format; in vmw_gb_surface_create()
1152 cmd3->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1153 cmd3->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1154 cmd3->body.multisamplePattern = metadata->multisample_pattern; in vmw_gb_surface_create()
1155 cmd3->body.qualityLevel = metadata->quality_level; in vmw_gb_surface_create()
1156 cmd3->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1157 cmd3->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1158 cmd3->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1159 cmd3->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1160 cmd3->body.arraySize = metadata->array_size; in vmw_gb_surface_create()
1161 } else if (metadata->array_size > 0) { in vmw_gb_surface_create()
1165 cmd2->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1166 cmd2->body.format = metadata->format; in vmw_gb_surface_create()
1167 cmd2->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1168 cmd2->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1169 cmd2->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1170 cmd2->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1171 cmd2->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1172 cmd2->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1173 cmd2->body.arraySize = metadata->array_size; in vmw_gb_surface_create()
1178 cmd->body.surfaceFlags = metadata->flags; in vmw_gb_surface_create()
1179 cmd->body.format = metadata->format; in vmw_gb_surface_create()
1180 cmd->body.numMipLevels = metadata->mip_levels[0]; in vmw_gb_surface_create()
1181 cmd->body.multisampleCount = metadata->multisample_count; in vmw_gb_surface_create()
1182 cmd->body.autogenFilter = metadata->autogen_filter; in vmw_gb_surface_create()
1183 cmd->body.size.width = metadata->base_size.width; in vmw_gb_surface_create()
1184 cmd->body.size.height = metadata->base_size.height; in vmw_gb_surface_create()
1185 cmd->body.size.depth = metadata->base_size.depth; in vmw_gb_surface_create()
1457 struct vmw_surface_metadata metadata = {0}; in vmw_gb_surface_define_internal() local
1515 metadata.flags = svga3d_flags_64; in vmw_gb_surface_define_internal()
1516 metadata.format = req->base.format; in vmw_gb_surface_define_internal()
1517 metadata.mip_levels[0] = req->base.mip_levels; in vmw_gb_surface_define_internal()
1518 metadata.multisample_count = req->base.multisample_count; in vmw_gb_surface_define_internal()
1519 metadata.multisample_pattern = req->multisample_pattern; in vmw_gb_surface_define_internal()
1520 metadata.quality_level = req->quality_level; in vmw_gb_surface_define_internal()
1521 metadata.array_size = req->base.array_size; in vmw_gb_surface_define_internal()
1522 metadata.buffer_byte_stride = req->buffer_byte_stride; in vmw_gb_surface_define_internal()
1523 metadata.num_sizes = 1; in vmw_gb_surface_define_internal()
1524 metadata.base_size = req->base.base_size; in vmw_gb_surface_define_internal()
1525 metadata.scanout = req->base.drm_surface_flags & in vmw_gb_surface_define_internal()
1529 ret = vmw_gb_surface_define(dev_priv, size, &metadata, &srf); in vmw_gb_surface_define_internal()
1642 struct vmw_surface_metadata *metadata; in vmw_gb_surface_reference_internal() local
1658 metadata = &srf->metadata; in vmw_gb_surface_reference_internal()
1672 rep->creq.base.svga3d_flags = SVGA3D_FLAGS_LOWER_32(metadata->flags); in vmw_gb_surface_reference_internal()
1673 rep->creq.base.format = metadata->format; in vmw_gb_surface_reference_internal()
1674 rep->creq.base.mip_levels = metadata->mip_levels[0]; in vmw_gb_surface_reference_internal()
1676 rep->creq.base.multisample_count = metadata->multisample_count; in vmw_gb_surface_reference_internal()
1677 rep->creq.base.autogen_filter = metadata->autogen_filter; in vmw_gb_surface_reference_internal()
1678 rep->creq.base.array_size = metadata->array_size; in vmw_gb_surface_reference_internal()
1680 rep->creq.base.base_size = metadata->base_size; in vmw_gb_surface_reference_internal()
1690 SVGA3D_FLAGS_UPPER_32(metadata->flags); in vmw_gb_surface_reference_internal()
1691 rep->creq.multisample_pattern = metadata->multisample_pattern; in vmw_gb_surface_reference_internal()
1692 rep->creq.quality_level = metadata->quality_level; in vmw_gb_surface_reference_internal()
1863 if (srf->metadata.format == SVGA3D_BUFFER) in vmw_surface_dirty_range_add()
1952 const struct vmw_surface_metadata *metadata = &srf->metadata; in vmw_surface_dirty_alloc() local
1965 if (metadata->array_size) in vmw_surface_dirty_alloc()
1966 num_layers = metadata->array_size; in vmw_surface_dirty_alloc()
1967 else if (metadata->flags & SVGA3D_SURFACE_CUBEMAP) in vmw_surface_dirty_alloc()
1970 num_mip = metadata->mip_levels[0]; in vmw_surface_dirty_alloc()
1991 num_samples = max_t(u32, 1, metadata->multisample_count); in vmw_surface_dirty_alloc()
1992 ret = vmw_surface_setup_cache(&metadata->base_size, metadata->format, in vmw_surface_dirty_alloc()
2069 struct vmw_surface_metadata *metadata; in vmw_gb_surface_define() local
2136 srf->metadata = *req; in vmw_gb_surface_define()
2139 metadata = &srf->metadata; in vmw_gb_surface_define()
2141 if (metadata->array_size) in vmw_gb_surface_define()
2143 else if (metadata->flags & SVGA3D_SURFACE_CUBEMAP) in vmw_gb_surface_define()
2146 if (metadata->flags & SVGA3D_SURFACE_MULTISAMPLE) in vmw_gb_surface_define()
2147 sample_count = metadata->multisample_count; in vmw_gb_surface_define()
2151 metadata->format, in vmw_gb_surface_define()
2152 metadata->base_size, in vmw_gb_surface_define()
2153 metadata->mip_levels[0], in vmw_gb_surface_define()
2157 if (metadata->flags & SVGA3D_SURFACE_BIND_STREAM_OUTPUT) in vmw_gb_surface_define()
2169 metadata->scanout && in vmw_gb_surface_define()
2170 metadata->base_size.width <= dev_priv->stdu_max_width && in vmw_gb_surface_define()
2171 metadata->base_size.height <= dev_priv->stdu_max_height) in vmw_gb_surface_define()
2172 metadata->flags |= SVGA3D_SURFACE_SCREENTARGET; in vmw_gb_surface_define()