Lines Matching refs:res
38 * @res: Base resource struct.
39 * @ctx: Non-refcounted context to which @res belong.
47 struct vmw_resource res;
56 static int vmw_dx_streamoutput_create(struct vmw_resource *res);
57 static int vmw_dx_streamoutput_bind(struct vmw_resource *res,
59 static int vmw_dx_streamoutput_unbind(struct vmw_resource *res, bool readback,
61 static void vmw_dx_streamoutput_commit_notify(struct vmw_resource *res,
79 vmw_res_to_dx_streamoutput(struct vmw_resource *res)
81 return container_of(res, struct vmw_dx_streamoutput, res);
86 * @res: The streamoutput resource.
90 static int vmw_dx_streamoutput_unscrub(struct vmw_resource *res)
92 struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res);
93 struct vmw_private *dev_priv = res->dev_priv;
109 cmd->body.mobid = res->guest_memory_bo->tbo.resource->start;
110 cmd->body.offsetInBytes = res->guest_memory_offset;
119 static int vmw_dx_streamoutput_create(struct vmw_resource *res)
121 struct vmw_private *dev_priv = res->dev_priv;
122 struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res);
127 if (vmw_resource_mob_attached(res)) {
129 ret = vmw_dx_streamoutput_unscrub(res);
133 res->id = so->id;
138 static int vmw_dx_streamoutput_bind(struct vmw_resource *res,
141 struct vmw_private *dev_priv = res->dev_priv;
149 ret = vmw_dx_streamoutput_unscrub(res);
157 * @res: The streamoutput resource.
161 static int vmw_dx_streamoutput_scrub(struct vmw_resource *res)
163 struct vmw_private *dev_priv = res->dev_priv;
164 struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res);
181 cmd->body.soid = res->id;
187 res->id = -1;
193 static int vmw_dx_streamoutput_unbind(struct vmw_resource *res, bool readback,
196 struct vmw_private *dev_priv = res->dev_priv;
200 if (WARN_ON(res->guest_memory_bo->tbo.resource->mem_type != VMW_PL_MOB))
204 ret = vmw_dx_streamoutput_scrub(res);
219 static void vmw_dx_streamoutput_commit_notify(struct vmw_resource *res,
222 struct vmw_private *dev_priv = res->dev_priv;
223 struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res);
229 res->id = so->id;
235 res->id = -1;
255 static void vmw_dx_streamoutput_res_free(struct vmw_resource *res)
257 struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res);
263 static void vmw_dx_streamoutput_hw_destroy(struct vmw_resource *res)
266 res->id = -1;
283 struct vmw_resource *res;
292 res = &so->res;
299 ret = vmw_resource_init(dev_priv, res, true,
306 res, list);
310 res->id = so->id;
311 res->hw_destroy = vmw_dx_streamoutput_hw_destroy;
314 vmw_resource_unreference(&res);
320 * vmw_dx_streamoutput_set_size - Sets streamoutput mob size in res struct.
321 * @res: The streamoutput res for which need to set size.
324 void vmw_dx_streamoutput_set_size(struct vmw_resource *res, u32 size)
326 struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res);
364 WARN_ON(vmw_dx_streamoutput_scrub(&entry->res));