-
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: add support for color processing blocks in dpu driver
This change adds support to configure dspp blocks in the dpu driver. Macro description of the changes coming in this patch. 1) Add dspp definitions in the hw catalog. 2) Add capability to reserve dspp blocks in the display data path. 3) Attach the reserved block to the encoder. Signed-off-by: Kalyan Thota <kalyan_t@codeaurora.org> Tested-by: Fritz Koenig <frkoenig@google.com> Signed-off-by: Rob Clark <robdclark@chromium.org>
- Loading branch information
Kalyan Thota
authored and
Rob Clark
committed
May 18, 2020
1 parent
e433787
commit e47616d
Showing
14 changed files
with
322 additions
and
15 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
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,82 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. | ||
*/ | ||
|
||
#include "dpu_hwio.h" | ||
#include "dpu_hw_catalog.h" | ||
#include "dpu_hw_lm.h" | ||
#include "dpu_hw_dspp.h" | ||
#include "dpu_kms.h" | ||
|
||
|
||
static void _setup_dspp_ops(struct dpu_hw_dspp *c, | ||
unsigned long features) | ||
{ | ||
return; | ||
} | ||
|
||
static const struct dpu_dspp_cfg *_dspp_offset(enum dpu_dspp dspp, | ||
const struct dpu_mdss_cfg *m, | ||
void __iomem *addr, | ||
struct dpu_hw_blk_reg_map *b) | ||
{ | ||
int i; | ||
|
||
if (!m || !addr || !b) | ||
return ERR_PTR(-EINVAL); | ||
|
||
for (i = 0; i < m->dspp_count; i++) { | ||
if (dspp == m->dspp[i].id) { | ||
b->base_off = addr; | ||
b->blk_off = m->dspp[i].base; | ||
b->length = m->dspp[i].len; | ||
b->hwversion = m->hwversion; | ||
b->log_mask = DPU_DBG_MASK_DSPP; | ||
return &m->dspp[i]; | ||
} | ||
} | ||
|
||
return ERR_PTR(-EINVAL); | ||
} | ||
|
||
static struct dpu_hw_blk_ops dpu_hw_ops; | ||
|
||
struct dpu_hw_dspp *dpu_hw_dspp_init(enum dpu_dspp idx, | ||
void __iomem *addr, | ||
const struct dpu_mdss_cfg *m) | ||
{ | ||
struct dpu_hw_dspp *c; | ||
const struct dpu_dspp_cfg *cfg; | ||
|
||
if (!addr || !m) | ||
return ERR_PTR(-EINVAL); | ||
|
||
c = kzalloc(sizeof(*c), GFP_KERNEL); | ||
if (!c) | ||
return ERR_PTR(-ENOMEM); | ||
|
||
cfg = _dspp_offset(idx, m, addr, &c->hw); | ||
if (IS_ERR_OR_NULL(cfg)) { | ||
kfree(c); | ||
return ERR_PTR(-EINVAL); | ||
} | ||
|
||
/* Assign ops */ | ||
c->idx = idx; | ||
c->cap = cfg; | ||
_setup_dspp_ops(c, c->cap->features); | ||
|
||
dpu_hw_blk_init(&c->base, DPU_HW_BLK_DSPP, idx, &dpu_hw_ops); | ||
|
||
return c; | ||
} | ||
|
||
void dpu_hw_dspp_destroy(struct dpu_hw_dspp *dspp) | ||
{ | ||
if (dspp) | ||
dpu_hw_blk_destroy(&dspp->base); | ||
|
||
kfree(dspp); | ||
} | ||
|
||
|
Oops, something went wrong.