-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/msm/dpu: initial support for merge3D hardware block
Add initial support for merge3D hardware block on SM8[12]50. Merge3D is reposible for merging contents of two LMs (two PPs) into single interface. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
- Loading branch information
Dmitry Baryshkov
authored and
Rob Clark
committed
Nov 4, 2020
1 parent
d8199c8
commit 4369c93
Showing
8 changed files
with
231 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. | ||
*/ | ||
|
||
#include <linux/iopoll.h> | ||
|
||
#include "dpu_hw_mdss.h" | ||
#include "dpu_hwio.h" | ||
#include "dpu_hw_catalog.h" | ||
#include "dpu_hw_merge3d.h" | ||
#include "dpu_kms.h" | ||
#include "dpu_trace.h" | ||
|
||
static const struct dpu_merge_3d_cfg *_merge_3d_offset(enum dpu_merge_3d idx, | ||
const struct dpu_mdss_cfg *m, | ||
void __iomem *addr, | ||
struct dpu_hw_blk_reg_map *b) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < m->merge_3d_count; i++) { | ||
if (idx == m->merge_3d[i].id) { | ||
b->base_off = addr; | ||
b->blk_off = m->merge_3d[i].base; | ||
b->length = m->merge_3d[i].len; | ||
b->hwversion = m->hwversion; | ||
b->log_mask = DPU_DBG_MASK_PINGPONG; | ||
return &m->merge_3d[i]; | ||
} | ||
} | ||
|
||
return ERR_PTR(-EINVAL); | ||
} | ||
|
||
static void _setup_merge_3d_ops(struct dpu_hw_merge_3d *c, | ||
unsigned long features) | ||
{ | ||
}; | ||
|
||
static struct dpu_hw_blk_ops dpu_hw_ops; | ||
|
||
struct dpu_hw_merge_3d *dpu_hw_merge_3d_init(enum dpu_merge_3d idx, | ||
void __iomem *addr, | ||
const struct dpu_mdss_cfg *m) | ||
{ | ||
struct dpu_hw_merge_3d *c; | ||
const struct dpu_merge_3d_cfg *cfg; | ||
|
||
c = kzalloc(sizeof(*c), GFP_KERNEL); | ||
if (!c) | ||
return ERR_PTR(-ENOMEM); | ||
|
||
cfg = _merge_3d_offset(idx, m, addr, &c->hw); | ||
if (IS_ERR_OR_NULL(cfg)) { | ||
kfree(c); | ||
return ERR_PTR(-EINVAL); | ||
} | ||
|
||
c->idx = idx; | ||
c->caps = cfg; | ||
_setup_merge_3d_ops(c, c->caps->features); | ||
|
||
dpu_hw_blk_init(&c->base, DPU_HW_BLK_MERGE_3D, idx, &dpu_hw_ops); | ||
|
||
return c; | ||
} | ||
|
||
void dpu_hw_merge_3d_destroy(struct dpu_hw_merge_3d *hw) | ||
{ | ||
if (hw) | ||
dpu_hw_blk_destroy(&hw->base); | ||
kfree(hw); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. | ||
*/ | ||
|
||
#ifndef _DPU_HW_MERGE3D_H | ||
#define _DPU_HW_MERGE3D_H | ||
|
||
#include "dpu_hw_catalog.h" | ||
#include "dpu_hw_mdss.h" | ||
#include "dpu_hw_util.h" | ||
#include "dpu_hw_blk.h" | ||
|
||
struct dpu_hw_merge_3d; | ||
|
||
/** | ||
* | ||
* struct dpu_hw_merge_3d_ops : Interface to the merge_3d Hw driver functions | ||
* Assumption is these functions will be called after clocks are enabled | ||
*/ | ||
struct dpu_hw_merge_3d_ops { | ||
}; | ||
|
||
struct dpu_hw_merge_3d { | ||
struct dpu_hw_blk base; | ||
struct dpu_hw_blk_reg_map hw; | ||
|
||
/* merge_3d */ | ||
enum dpu_merge_3d idx; | ||
const struct dpu_merge_3d_cfg *caps; | ||
|
||
/* ops */ | ||
struct dpu_hw_merge_3d_ops ops; | ||
}; | ||
|
||
/** | ||
* to_dpu_hw_merge_3d - convert base object dpu_hw_base to container | ||
* @hw: Pointer to base hardware block | ||
* return: Pointer to hardware block container | ||
*/ | ||
static inline struct dpu_hw_merge_3d *to_dpu_hw_merge_3d(struct dpu_hw_blk *hw) | ||
{ | ||
return container_of(hw, struct dpu_hw_merge_3d, base); | ||
} | ||
|
||
/** | ||
* dpu_hw_merge_3d_init - initializes the merge_3d driver for the passed | ||
* merge_3d idx. | ||
* @idx: Pingpong index for which driver object is required | ||
* @addr: Mapped register io address of MDP | ||
* @m: Pointer to mdss catalog data | ||
* Returns: Error code or allocated dpu_hw_merge_3d context | ||
*/ | ||
struct dpu_hw_merge_3d *dpu_hw_merge_3d_init(enum dpu_merge_3d idx, | ||
void __iomem *addr, | ||
const struct dpu_mdss_cfg *m); | ||
|
||
/** | ||
* dpu_hw_merge_3d_destroy - destroys merge_3d driver context | ||
* should be called to free the context | ||
* @pp: Pointer to PP driver context returned by dpu_hw_merge_3d_init | ||
*/ | ||
void dpu_hw_merge_3d_destroy(struct dpu_hw_merge_3d *pp); | ||
|
||
#endif /*_DPU_HW_MERGE3D_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters