Lines Matching refs:plane

79 static inline unsigned int tegra_plane_offset(struct tegra_plane *plane,  in tegra_plane_offset()  argument
84 return plane->offset + offset; in tegra_plane_offset()
89 return plane->offset + offset; in tegra_plane_offset()
94 return plane->offset + offset; in tegra_plane_offset()
97 dev_WARN(plane->dc->dev, "invalid offset: %x\n", offset); in tegra_plane_offset()
99 return plane->offset + offset; in tegra_plane_offset()
102 static inline u32 tegra_plane_readl(struct tegra_plane *plane, in tegra_plane_readl() argument
105 return tegra_dc_readl(plane->dc, tegra_plane_offset(plane, offset)); in tegra_plane_readl()
108 static inline void tegra_plane_writel(struct tegra_plane *plane, u32 value, in tegra_plane_writel() argument
111 tegra_dc_writel(plane->dc, value, tegra_plane_offset(plane, offset)); in tegra_plane_writel()
195 static void tegra_shared_plane_update(struct tegra_plane *plane) in tegra_shared_plane_update() argument
197 struct tegra_dc *dc = plane->dc; in tegra_shared_plane_update()
201 mask = COMMON_UPDATE | WIN_A_UPDATE << plane->base.index; in tegra_shared_plane_update()
215 static void tegra_shared_plane_activate(struct tegra_plane *plane) in tegra_shared_plane_activate() argument
217 struct tegra_dc *dc = plane->dc; in tegra_shared_plane_activate()
221 mask = COMMON_ACTREQ | WIN_A_ACT_REQ << plane->base.index; in tegra_shared_plane_activate()
236 tegra_shared_plane_get_owner(struct tegra_plane *plane, struct tegra_dc *dc) in tegra_shared_plane_get_owner() argument
239 tegra_plane_offset(plane, DC_WIN_CORE_WINDOWGROUP_SET_CONTROL); in tegra_shared_plane_get_owner()
245 struct tegra_plane *plane) in tegra_dc_owns_shared_plane() argument
249 if (tegra_shared_plane_get_owner(plane, dc) == dc->pipe) { in tegra_dc_owns_shared_plane()
250 if (plane->dc == dc) in tegra_dc_owns_shared_plane()
254 dc->pipe, plane->index); in tegra_dc_owns_shared_plane()
260 static int tegra_shared_plane_set_owner(struct tegra_plane *plane, in tegra_shared_plane_set_owner() argument
264 tegra_plane_offset(plane, DC_WIN_CORE_WINDOWGROUP_SET_CONTROL); in tegra_shared_plane_set_owner()
265 struct tegra_dc *old = plane->dc, *dc = new ? new : old; in tegra_shared_plane_set_owner()
267 unsigned int owner, index = plane->index; in tegra_shared_plane_set_owner()
296 plane->dc = new; in tegra_shared_plane_set_owner()
301 static void tegra_shared_plane_setup_scaler(struct tegra_plane *plane) in tegra_shared_plane_setup_scaler() argument
362 tegra_plane_writel(plane, value, in tegra_shared_plane_setup_scaler()
370 struct tegra_plane *plane) in tegra_dc_assign_shared_plane() argument
375 if (!tegra_dc_owns_shared_plane(dc, plane)) { in tegra_dc_assign_shared_plane()
376 err = tegra_shared_plane_set_owner(plane, dc); in tegra_dc_assign_shared_plane()
381 value = tegra_plane_readl(plane, DC_WIN_CORE_IHUB_LINEBUF_CONFIG); in tegra_dc_assign_shared_plane()
383 tegra_plane_writel(plane, value, DC_WIN_CORE_IHUB_LINEBUF_CONFIG); in tegra_dc_assign_shared_plane()
385 value = tegra_plane_readl(plane, DC_WIN_CORE_IHUB_WGRP_FETCH_METER); in tegra_dc_assign_shared_plane()
387 tegra_plane_writel(plane, value, DC_WIN_CORE_IHUB_WGRP_FETCH_METER); in tegra_dc_assign_shared_plane()
390 value = tegra_plane_readl(plane, DC_WIN_CORE_IHUB_WGRP_LATENCY_CTLA); in tegra_dc_assign_shared_plane()
392 tegra_plane_writel(plane, value, DC_WIN_CORE_IHUB_WGRP_LATENCY_CTLA); in tegra_dc_assign_shared_plane()
394 value = tegra_plane_readl(plane, DC_WIN_CORE_IHUB_WGRP_LATENCY_CTLB); in tegra_dc_assign_shared_plane()
396 tegra_plane_writel(plane, value, DC_WIN_CORE_IHUB_WGRP_LATENCY_CTLB); in tegra_dc_assign_shared_plane()
399 value = tegra_plane_readl(plane, DC_WIN_CORE_PRECOMP_WGRP_PIPE_METER); in tegra_dc_assign_shared_plane()
401 tegra_plane_writel(plane, value, DC_WIN_CORE_PRECOMP_WGRP_PIPE_METER); in tegra_dc_assign_shared_plane()
404 value = tegra_plane_readl(plane, DC_WIN_CORE_IHUB_WGRP_POOL_CONFIG); in tegra_dc_assign_shared_plane()
406 tegra_plane_writel(plane, value, DC_WIN_CORE_IHUB_WGRP_POOL_CONFIG); in tegra_dc_assign_shared_plane()
408 value = tegra_plane_readl(plane, DC_WIN_CORE_IHUB_THREAD_GROUP); in tegra_dc_assign_shared_plane()
410 value |= THREAD_NUM(plane->base.index); in tegra_dc_assign_shared_plane()
412 tegra_plane_writel(plane, value, DC_WIN_CORE_IHUB_THREAD_GROUP); in tegra_dc_assign_shared_plane()
414 tegra_shared_plane_setup_scaler(plane); in tegra_dc_assign_shared_plane()
416 tegra_shared_plane_update(plane); in tegra_dc_assign_shared_plane()
417 tegra_shared_plane_activate(plane); in tegra_dc_assign_shared_plane()
421 struct tegra_plane *plane) in tegra_dc_remove_shared_plane() argument
423 tegra_shared_plane_set_owner(plane, NULL); in tegra_dc_remove_shared_plane()
426 static int tegra_shared_plane_atomic_check(struct drm_plane *plane, in tegra_shared_plane_atomic_check() argument
430 plane); in tegra_shared_plane_atomic_check()
432 struct tegra_shared_plane *tegra = to_tegra_shared_plane(plane); in tegra_shared_plane_atomic_check()
484 static void tegra_shared_plane_atomic_disable(struct drm_plane *plane, in tegra_shared_plane_atomic_disable() argument
488 plane); in tegra_shared_plane_atomic_disable()
489 struct tegra_plane *p = to_tegra_plane(plane); in tegra_shared_plane_atomic_disable()
534 static void tegra_shared_plane_atomic_update(struct drm_plane *plane, in tegra_shared_plane_atomic_update() argument
538 plane); in tegra_shared_plane_atomic_update()
543 struct tegra_plane *p = to_tegra_plane(plane); in tegra_shared_plane_atomic_update()
555 tegra_shared_plane_atomic_disable(plane, state); in tegra_shared_plane_atomic_update()
765 struct tegra_shared_plane *plane; in tegra_shared_plane_create() local
773 plane = kzalloc_obj(*plane); in tegra_shared_plane_create()
774 if (!plane) in tegra_shared_plane_create()
777 plane->base.offset = 0x0a00 + 0x0300 * index; in tegra_shared_plane_create()
778 plane->base.index = index; in tegra_shared_plane_create()
780 plane->wgrp = &hub->wgrps[wgrp]; in tegra_shared_plane_create()
781 plane->wgrp->parent = &dc->client; in tegra_shared_plane_create()
783 p = &plane->base.base; in tegra_shared_plane_create()
796 kfree(plane); in tegra_shared_plane_create()