drm/msm/mdp5: use 2 memory clients for YUV formats on newer mdp5
Newer MDP5 uses 2 shared memory pool clients for certain YUV formats. For example, if VIG0 is used to fetch data in YUYV format, it will use VIG0_Y for Y component, and VIG0_Cr for UV packed. Signed-off-by: Wentao Xu <wentaox@codeaurora.org> [rebase] Signed-off-by: Stephane Viau <sviau@codeaurora.org>
This commit is contained in:
parent
ff78a6b377
commit
9cc137a3ff
|
@ -544,7 +544,7 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
|
|||
|
||||
/* Request some memory from the SMP: */
|
||||
ret = mdp5_smp_request(mdp5_kms->smp,
|
||||
mdp5_plane->pipe, fb->pixel_format, src_w);
|
||||
mdp5_plane->pipe, format, src_w, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -90,6 +90,8 @@
|
|||
struct mdp5_smp {
|
||||
struct drm_device *dev;
|
||||
|
||||
const struct mdp5_smp_block *cfg;
|
||||
|
||||
int blk_cnt;
|
||||
int blk_size;
|
||||
|
||||
|
@ -137,14 +139,12 @@ static int smp_request_block(struct mdp5_smp *smp,
|
|||
u32 cid, int nblks)
|
||||
{
|
||||
struct mdp5_kms *mdp5_kms = get_kms(smp);
|
||||
const struct mdp5_cfg_hw *hw_cfg;
|
||||
struct mdp5_client_smp_state *ps = &smp->client_state[cid];
|
||||
int i, ret, avail, cur_nblks, cnt = smp->blk_cnt;
|
||||
int reserved;
|
||||
unsigned long flags;
|
||||
|
||||
hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);
|
||||
reserved = hw_cfg->smp.reserved[cid];
|
||||
reserved = smp->cfg->reserved[cid];
|
||||
|
||||
spin_lock_irqsave(&smp->state_lock, flags);
|
||||
|
||||
|
@ -209,12 +209,14 @@ static void set_fifo_thresholds(struct mdp5_smp *smp,
|
|||
* decimated width. Ie. SMP buffering sits downstream of decimation (which
|
||||
* presumably happens during the dma from scanout buffer).
|
||||
*/
|
||||
int mdp5_smp_request(struct mdp5_smp *smp, enum mdp5_pipe pipe, u32 fmt, u32 width)
|
||||
int mdp5_smp_request(struct mdp5_smp *smp, enum mdp5_pipe pipe,
|
||||
const struct mdp_format *format, u32 width, bool hdecim)
|
||||
{
|
||||
struct mdp5_kms *mdp5_kms = get_kms(smp);
|
||||
struct drm_device *dev = mdp5_kms->dev;
|
||||
int rev = mdp5_cfg_get_hw_rev(mdp5_kms->cfg);
|
||||
int i, hsub, nplanes, nlines, nblks, ret;
|
||||
u32 fmt = format->base.pixel_format;
|
||||
|
||||
nplanes = drm_format_num_planes(fmt);
|
||||
hsub = drm_format_horz_chroma_subsampling(fmt);
|
||||
|
@ -222,6 +224,21 @@ int mdp5_smp_request(struct mdp5_smp *smp, enum mdp5_pipe pipe, u32 fmt, u32 wid
|
|||
/* different if BWC (compressed framebuffer?) enabled: */
|
||||
nlines = 2;
|
||||
|
||||
/* Newer MDPs have split/packing logic, which fetches sub-sampled
|
||||
* U and V components (splits them from Y if necessary) and packs
|
||||
* them together, writes to SMP using a single client.
|
||||
*/
|
||||
if ((rev > 0) && (format->chroma_sample > CHROMA_FULL)) {
|
||||
fmt = DRM_FORMAT_NV24;
|
||||
nplanes = 2;
|
||||
|
||||
/* if decimation is enabled, HW decimates less on the
|
||||
* sub sampled chroma components
|
||||
*/
|
||||
if (hdecim && (hsub > 1))
|
||||
hsub = 1;
|
||||
}
|
||||
|
||||
for (i = 0, nblks = 0; i < nplanes; i++) {
|
||||
int n, fetch_stride, cpp;
|
||||
|
||||
|
@ -388,6 +405,7 @@ struct mdp5_smp *mdp5_smp_init(struct drm_device *dev, const struct mdp5_smp_blo
|
|||
}
|
||||
|
||||
smp->dev = dev;
|
||||
smp->cfg = cfg;
|
||||
smp->blk_cnt = cfg->mmb_count;
|
||||
smp->blk_size = cfg->mmb_size;
|
||||
|
||||
|
|
|
@ -39,7 +39,8 @@ struct mdp5_smp;
|
|||
struct mdp5_smp *mdp5_smp_init(struct drm_device *dev, const struct mdp5_smp_block *cfg);
|
||||
void mdp5_smp_destroy(struct mdp5_smp *smp);
|
||||
|
||||
int mdp5_smp_request(struct mdp5_smp *smp, enum mdp5_pipe pipe, u32 fmt, u32 width);
|
||||
int mdp5_smp_request(struct mdp5_smp *smp, enum mdp5_pipe pipe,
|
||||
const struct mdp_format *format, u32 width, bool hdecim);
|
||||
void mdp5_smp_configure(struct mdp5_smp *smp, enum mdp5_pipe pipe);
|
||||
void mdp5_smp_commit(struct mdp5_smp *smp, enum mdp5_pipe pipe);
|
||||
void mdp5_smp_release(struct mdp5_smp *smp, enum mdp5_pipe pipe);
|
||||
|
|
Loading…
Reference in New Issue