Lines Matching refs:plane
39 static inline struct tegra_plane *to_tegra_plane(struct drm_plane *plane) in to_tegra_plane() argument
41 return container_of(plane, struct tegra_plane, base); in to_tegra_plane()
405 static void tegra_plane_destroy(struct drm_plane *plane) in tegra_plane_destroy() argument
407 struct tegra_plane *p = to_tegra_plane(plane); in tegra_plane_destroy()
409 drm_plane_cleanup(plane); in tegra_plane_destroy()
419 static void tegra_primary_plane_destroy(struct drm_plane *plane) in tegra_primary_plane_destroy() argument
421 tegra_plane_destroy(plane); in tegra_primary_plane_destroy()
424 static void tegra_plane_reset(struct drm_plane *plane) in tegra_plane_reset() argument
428 if (plane->state) in tegra_plane_reset()
429 __drm_atomic_helper_plane_destroy_state(plane, plane->state); in tegra_plane_reset()
431 kfree(plane->state); in tegra_plane_reset()
432 plane->state = NULL; in tegra_plane_reset()
436 plane->state = &state->base; in tegra_plane_reset()
437 plane->state->plane = plane; in tegra_plane_reset()
441 static struct drm_plane_state *tegra_plane_atomic_duplicate_state(struct drm_plane *plane) in tegra_plane_atomic_duplicate_state() argument
443 struct tegra_plane_state *state = to_tegra_plane_state(plane->state); in tegra_plane_atomic_duplicate_state()
450 __drm_atomic_helper_plane_duplicate_state(plane, ©->base); in tegra_plane_atomic_duplicate_state()
458 static void tegra_plane_atomic_destroy_state(struct drm_plane *plane, in tegra_plane_atomic_destroy_state() argument
461 __drm_atomic_helper_plane_destroy_state(plane, state); in tegra_plane_atomic_destroy_state()
474 static int tegra_plane_prepare_fb(struct drm_plane *plane, in tegra_plane_prepare_fb() argument
481 static void tegra_plane_cleanup_fb(struct drm_plane *plane, in tegra_plane_cleanup_fb() argument
487 static int tegra_plane_state_add(struct tegra_plane *plane, in tegra_plane_state_add() argument
500 tegra->planes |= WIN_A_ACT_REQ << plane->index; in tegra_plane_state_add()
505 static int tegra_plane_atomic_check(struct drm_plane *plane, in tegra_plane_atomic_check() argument
510 struct tegra_plane *tegra = to_tegra_plane(plane); in tegra_plane_atomic_check()
552 static void tegra_plane_atomic_update(struct drm_plane *plane, in tegra_plane_atomic_update() argument
555 struct tegra_plane_state *state = to_tegra_plane_state(plane->state); in tegra_plane_atomic_update()
556 struct tegra_dc *dc = to_tegra_dc(plane->state->crtc); in tegra_plane_atomic_update()
557 struct drm_framebuffer *fb = plane->state->fb; in tegra_plane_atomic_update()
558 struct tegra_plane *p = to_tegra_plane(plane); in tegra_plane_atomic_update()
563 if (!plane->state->crtc || !plane->state->fb) in tegra_plane_atomic_update()
567 window.src.x = plane->state->src_x >> 16; in tegra_plane_atomic_update()
568 window.src.y = plane->state->src_y >> 16; in tegra_plane_atomic_update()
569 window.src.w = plane->state->src_w >> 16; in tegra_plane_atomic_update()
570 window.src.h = plane->state->src_h >> 16; in tegra_plane_atomic_update()
571 window.dst.x = plane->state->crtc_x; in tegra_plane_atomic_update()
572 window.dst.y = plane->state->crtc_y; in tegra_plane_atomic_update()
573 window.dst.w = plane->state->crtc_w; in tegra_plane_atomic_update()
574 window.dst.h = plane->state->crtc_h; in tegra_plane_atomic_update()
593 static void tegra_plane_atomic_disable(struct drm_plane *plane, in tegra_plane_atomic_disable() argument
596 struct tegra_plane *p = to_tegra_plane(plane); in tegra_plane_atomic_disable()
643 struct tegra_plane *plane; in tegra_dc_primary_plane_create() local
648 plane = kzalloc(sizeof(*plane), GFP_KERNEL); in tegra_dc_primary_plane_create()
649 if (!plane) in tegra_dc_primary_plane_create()
655 err = drm_universal_plane_init(drm, &plane->base, possible_crtcs, in tegra_dc_primary_plane_create()
659 kfree(plane); in tegra_dc_primary_plane_create()
663 drm_plane_helper_add(&plane->base, &tegra_primary_plane_helper_funcs); in tegra_dc_primary_plane_create()
665 return &plane->base; in tegra_dc_primary_plane_create()
672 static int tegra_cursor_atomic_check(struct drm_plane *plane, in tegra_cursor_atomic_check() argument
675 struct tegra_plane *tegra = to_tegra_plane(plane); in tegra_cursor_atomic_check()
702 static void tegra_cursor_atomic_update(struct drm_plane *plane, in tegra_cursor_atomic_update() argument
705 struct tegra_bo *bo = tegra_fb_get_plane(plane->state->fb, 0); in tegra_cursor_atomic_update()
706 struct tegra_dc *dc = to_tegra_dc(plane->state->crtc); in tegra_cursor_atomic_update()
707 struct drm_plane_state *state = plane->state; in tegra_cursor_atomic_update()
711 if (!plane->state->crtc || !plane->state->fb) in tegra_cursor_atomic_update()
765 static void tegra_cursor_atomic_disable(struct drm_plane *plane, in tegra_cursor_atomic_disable() argument
802 struct tegra_plane *plane; in tegra_dc_cursor_plane_create() local
807 plane = kzalloc(sizeof(*plane), GFP_KERNEL); in tegra_dc_cursor_plane_create()
808 if (!plane) in tegra_dc_cursor_plane_create()
816 plane->index = 6; in tegra_dc_cursor_plane_create()
821 err = drm_universal_plane_init(drm, &plane->base, 1 << dc->pipe, in tegra_dc_cursor_plane_create()
825 kfree(plane); in tegra_dc_cursor_plane_create()
829 drm_plane_helper_add(&plane->base, &tegra_cursor_plane_helper_funcs); in tegra_dc_cursor_plane_create()
831 return &plane->base; in tegra_dc_cursor_plane_create()
834 static void tegra_overlay_plane_destroy(struct drm_plane *plane) in tegra_overlay_plane_destroy() argument
836 tegra_plane_destroy(plane); in tegra_overlay_plane_destroy()
870 struct tegra_plane *plane; in tegra_dc_overlay_plane_create() local
875 plane = kzalloc(sizeof(*plane), GFP_KERNEL); in tegra_dc_overlay_plane_create()
876 if (!plane) in tegra_dc_overlay_plane_create()
879 plane->index = index; in tegra_dc_overlay_plane_create()
884 err = drm_universal_plane_init(drm, &plane->base, 1 << dc->pipe, in tegra_dc_overlay_plane_create()
888 kfree(plane); in tegra_dc_overlay_plane_create()
892 drm_plane_helper_add(&plane->base, &tegra_overlay_plane_helper_funcs); in tegra_dc_overlay_plane_create()
894 return &plane->base; in tegra_dc_overlay_plane_create()
899 struct drm_plane *plane; in tegra_dc_add_planes() local
903 plane = tegra_dc_overlay_plane_create(drm, dc, 1 + i); in tegra_dc_add_planes()
904 if (IS_ERR(plane)) in tegra_dc_add_planes()
905 return PTR_ERR(plane); in tegra_dc_add_planes()