Lines Matching refs:plane

113 nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
120 struct nouveau_drm *drm = nouveau_drm(plane->dev);
123 container_of(plane, struct nouveau_plane, base);
192 nv10_disable_plane(struct drm_plane *plane,
195 struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
197 container_of(plane, struct nouveau_plane, base);
209 nv_destroy_plane(struct drm_plane *plane)
211 drm_plane_force_disable(plane);
212 drm_plane_cleanup(plane);
213 kfree(plane);
217 nv10_set_params(struct nouveau_plane *plane)
219 struct nvif_object *dev = &nouveau_drm(plane->base.dev)->client.device.object;
220 u32 luma = (plane->brightness - 512) << 16 | plane->contrast;
221 u32 chroma = ((sin_mul(plane->hue, plane->saturation) & 0xffff) << 16) |
222 (cos_mul(plane->hue, plane->saturation) & 0xffff);
229 nvif_wr32(dev, NV_PVIDEO_COLOR_KEY, plane->colorkey & 0xffffff);
231 if (plane->cur) {
232 if (plane->color_encoding == DRM_COLOR_YCBCR_BT709)
234 if (plane->colorkey & (1 << 24))
236 nvif_mask(dev, NV_PVIDEO_FORMAT(plane->flip),
244 nv_set_property(struct drm_plane *plane,
249 container_of(plane, struct nouveau_plane, base);
282 struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL);
286 if (!plane)
299 ret = drm_plane_init(device, &plane->base, 3 /* both crtc's */,
305 /* Set up the plane properties */
306 plane->props.colorkey = drm_property_create_range(
308 plane->props.contrast = drm_property_create_range(
310 plane->props.brightness = drm_property_create_range(
312 plane->props.hue = drm_property_create_range(
314 plane->props.saturation = drm_property_create_range(
316 if (!plane->props.colorkey ||
317 !plane->props.contrast ||
318 !plane->props.brightness ||
319 !plane->props.hue ||
320 !plane->props.saturation)
323 plane->colorkey = 0;
324 drm_object_attach_property(&plane->base.base,
325 plane->props.colorkey, plane->colorkey);
327 plane->contrast = 0x1000;
328 drm_object_attach_property(&plane->base.base,
329 plane->props.contrast, plane->contrast);
331 plane->brightness = 512;
332 drm_object_attach_property(&plane->base.base,
333 plane->props.brightness, plane->brightness);
335 plane->hue = 0;
336 drm_object_attach_property(&plane->base.base,
337 plane->props.hue, plane->hue);
339 plane->saturation = 0x1000;
340 drm_object_attach_property(&plane->base.base,
341 plane->props.saturation, plane->saturation);
343 plane->color_encoding = DRM_COLOR_YCBCR_BT601;
344 drm_plane_create_color_properties(&plane->base,
351 plane->set_params = nv10_set_params;
352 nv10_set_params(plane);
353 drm_plane_force_disable(&plane->base);
356 drm_plane_cleanup(&plane->base);
358 kfree(plane);
359 NV_ERROR(drm, "Failed to create plane\n");
363 nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
370 struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
372 container_of(plane, struct nouveau_plane, base);
442 nv04_disable_plane(struct drm_plane *plane,
445 struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
447 container_of(plane, struct nouveau_plane, base);
472 struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL);
475 if (!plane)
478 ret = drm_plane_init(device, &plane->base, 1 /* single crtc */,
484 /* Set up the plane properties */
485 plane->props.colorkey = drm_property_create_range(
487 plane->props.brightness = drm_property_create_range(
489 if (!plane->props.colorkey ||
490 !plane->props.brightness)
493 plane->colorkey = 0;
494 drm_object_attach_property(&plane->base.base,
495 plane->props.colorkey, plane->colorkey);
497 plane->brightness = 512;
498 drm_object_attach_property(&plane->base.base,
499 plane->props.brightness, plane->brightness);
501 drm_plane_force_disable(&plane->base);
504 drm_plane_cleanup(&plane->base);
506 kfree(plane);
507 NV_ERROR(drm, "Failed to create plane\n");