2019-06-03 07:44:50 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Red Hat
|
|
|
|
* Author: Rob Clark <robdclark@gmail.com>
|
|
|
|
*/
|
|
|
|
|
2019-08-04 08:55:51 +02:00
|
|
|
#include <linux/delay.h>
|
|
|
|
|
2025-04-25 12:51:56 +03:00
|
|
|
#include <drm/drm_bridge.h>
|
|
|
|
#include <drm/drm_bridge_connector.h>
|
2019-08-04 08:55:51 +02:00
|
|
|
#include <drm/drm_vblank.h>
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
|
|
|
#include "msm_drv.h"
|
2016-09-28 19:58:32 -04:00
|
|
|
#include "msm_gem.h"
|
2013-11-16 12:56:06 -05:00
|
|
|
#include "msm_mmu.h"
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
#include "mdp4_kms.h"
|
|
|
|
|
|
|
|
static int mdp4_hw_init(struct msm_kms *kms)
|
|
|
|
{
|
2013-11-30 17:24:22 -05:00
|
|
|
struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
struct drm_device *dev = mdp4_kms->dev;
|
2021-07-06 01:16:41 +02:00
|
|
|
u32 dmap_cfg, vg_cfg;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
unsigned long clk;
|
|
|
|
|
|
|
|
pm_runtime_get_sync(dev->dev);
|
|
|
|
|
|
|
|
if (mdp4_kms->rev > 1) {
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_CS_CONTROLLER0, 0x0707ffff);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_CS_CONTROLLER1, 0x03073f3f);
|
|
|
|
}
|
|
|
|
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_PORTMAP_MODE, 0x3);
|
|
|
|
|
|
|
|
/* max read pending cmd config, 3 pending requests: */
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_READ_CNFG, 0x02222);
|
|
|
|
|
|
|
|
clk = clk_get_rate(mdp4_kms->clk);
|
|
|
|
|
|
|
|
if ((mdp4_kms->rev >= 1) || (clk >= 90000000)) {
|
|
|
|
dmap_cfg = 0x47; /* 16 bytes-burst x 8 req */
|
|
|
|
vg_cfg = 0x47; /* 16 bytes-burs x 8 req */
|
|
|
|
} else {
|
|
|
|
dmap_cfg = 0x27; /* 8 bytes-burst x 8 req */
|
|
|
|
vg_cfg = 0x43; /* 16 bytes-burst x 4 req */
|
|
|
|
}
|
|
|
|
|
|
|
|
DBG("fetch config: dmap=%02x, vg=%02x", dmap_cfg, vg_cfg);
|
|
|
|
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_DMA_FETCH_CONFIG(DMA_P), dmap_cfg);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_DMA_FETCH_CONFIG(DMA_E), dmap_cfg);
|
|
|
|
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(VG1), vg_cfg);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(VG2), vg_cfg);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(RGB1), vg_cfg);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_PIPE_FETCH_CONFIG(RGB2), vg_cfg);
|
|
|
|
|
|
|
|
if (mdp4_kms->rev >= 2)
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_LAYERMIXER_IN_CFG_UPDATE_METHOD, 1);
|
2014-08-06 07:43:12 -04:00
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_LAYERMIXER_IN_CFG, 0);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
|
|
|
/* disable CSC matrix / YUV by default: */
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_PIPE_OP_MODE(VG1), 0);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_PIPE_OP_MODE(VG2), 0);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_DMA_P_OP_MODE, 0);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_DMA_S_OP_MODE, 0);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_OVLP_CSC_CONFIG(1), 0);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_OVLP_CSC_CONFIG(2), 0);
|
|
|
|
|
|
|
|
if (mdp4_kms->rev > 1)
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_RESET_STATUS, 1);
|
|
|
|
|
|
|
|
pm_runtime_put_sync(dev->dev);
|
|
|
|
|
2022-04-25 20:22:21 +08:00
|
|
|
return 0;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
}
|
|
|
|
|
2019-08-29 09:45:15 -07:00
|
|
|
static void mdp4_enable_commit(struct msm_kms *kms)
|
|
|
|
{
|
|
|
|
struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));
|
|
|
|
mdp4_enable(mdp4_kms);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mdp4_disable_commit(struct msm_kms *kms)
|
2015-01-30 17:04:45 -05:00
|
|
|
{
|
|
|
|
struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));
|
2019-08-29 09:45:15 -07:00
|
|
|
mdp4_disable(mdp4_kms);
|
|
|
|
}
|
|
|
|
|
2019-08-29 09:45:14 -07:00
|
|
|
static void mdp4_flush_commit(struct msm_kms *kms, unsigned crtc_mask)
|
|
|
|
{
|
|
|
|
/* TODO */
|
|
|
|
}
|
|
|
|
|
2019-08-29 09:45:12 -07:00
|
|
|
static void mdp4_wait_flush(struct msm_kms *kms, unsigned crtc_mask)
|
|
|
|
{
|
|
|
|
struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));
|
|
|
|
struct drm_crtc *crtc;
|
|
|
|
|
|
|
|
for_each_crtc_mask(mdp4_kms->dev, crtc, crtc_mask)
|
|
|
|
mdp4_crtc_wait_for_commit_done(crtc);
|
|
|
|
}
|
|
|
|
|
2019-08-29 09:45:13 -07:00
|
|
|
static void mdp4_complete_commit(struct msm_kms *kms, unsigned crtc_mask)
|
2015-01-30 17:04:45 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
static long mdp4_round_pixclk(struct msm_kms *kms, unsigned long rate,
|
|
|
|
struct drm_encoder *encoder)
|
|
|
|
{
|
|
|
|
/* if we had >1 encoder, we'd need something more clever: */
|
2015-11-18 17:57:16 +05:30
|
|
|
switch (encoder->encoder_type) {
|
|
|
|
case DRM_MODE_ENCODER_TMDS:
|
|
|
|
return mdp4_dtv_round_pixclk(encoder, rate);
|
|
|
|
case DRM_MODE_ENCODER_LVDS:
|
|
|
|
case DRM_MODE_ENCODER_DSI:
|
|
|
|
default:
|
|
|
|
return rate;
|
|
|
|
}
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void mdp4_destroy(struct msm_kms *kms)
|
|
|
|
{
|
2013-11-30 17:24:22 -05:00
|
|
|
struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));
|
2016-06-15 18:04:31 +05:30
|
|
|
struct device *dev = mdp4_kms->dev->dev;
|
2016-02-25 11:19:44 +05:30
|
|
|
|
2014-04-22 12:27:28 -04:00
|
|
|
if (mdp4_kms->blank_cursor_iova)
|
2025-06-29 13:12:49 -07:00
|
|
|
msm_gem_unpin_iova(mdp4_kms->blank_cursor_bo, kms->vm);
|
2020-05-15 10:51:04 +01:00
|
|
|
drm_gem_object_put(mdp4_kms->blank_cursor_bo);
|
2016-06-15 18:04:31 +05:30
|
|
|
|
2025-06-29 13:12:58 -07:00
|
|
|
if (kms->vm) {
|
|
|
|
struct msm_mmu *mmu = to_msm_vm(kms->vm)->mmu;
|
|
|
|
|
|
|
|
mmu->funcs->detach(mmu);
|
|
|
|
drm_gpuvm_put(kms->vm);
|
2016-09-28 19:58:32 -04:00
|
|
|
}
|
|
|
|
|
2016-06-15 18:04:31 +05:30
|
|
|
if (mdp4_kms->rpm_enabled)
|
|
|
|
pm_runtime_disable(dev);
|
|
|
|
|
2020-10-19 14:10:52 -07:00
|
|
|
mdp_kms_destroy(&mdp4_kms->base);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
}
|
|
|
|
|
2013-11-30 17:24:22 -05:00
|
|
|
static const struct mdp_kms_funcs kms_funcs = {
|
|
|
|
.base = {
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
.hw_init = mdp4_hw_init,
|
|
|
|
.irq_preinstall = mdp4_irq_preinstall,
|
|
|
|
.irq_postinstall = mdp4_irq_postinstall,
|
|
|
|
.irq_uninstall = mdp4_irq_uninstall,
|
|
|
|
.irq = mdp4_irq,
|
|
|
|
.enable_vblank = mdp4_enable_vblank,
|
|
|
|
.disable_vblank = mdp4_disable_vblank,
|
2019-08-29 09:45:15 -07:00
|
|
|
.enable_commit = mdp4_enable_commit,
|
|
|
|
.disable_commit = mdp4_disable_commit,
|
2019-08-29 09:45:14 -07:00
|
|
|
.flush_commit = mdp4_flush_commit,
|
2019-08-29 09:45:12 -07:00
|
|
|
.wait_flush = mdp4_wait_flush,
|
2015-01-30 17:04:45 -05:00
|
|
|
.complete_commit = mdp4_complete_commit,
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
.round_pixclk = mdp4_round_pixclk,
|
|
|
|
.destroy = mdp4_destroy,
|
2013-11-30 17:24:22 -05:00
|
|
|
},
|
|
|
|
.set_irqmask = mdp4_set_irqmask,
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
int mdp4_disable(struct mdp4_kms *mdp4_kms)
|
|
|
|
{
|
|
|
|
DBG("");
|
|
|
|
|
|
|
|
clk_disable_unprepare(mdp4_kms->clk);
|
2020-12-31 09:41:55 +00:00
|
|
|
clk_disable_unprepare(mdp4_kms->pclk);
|
|
|
|
clk_disable_unprepare(mdp4_kms->lut_clk);
|
|
|
|
clk_disable_unprepare(mdp4_kms->axi_clk);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int mdp4_enable(struct mdp4_kms *mdp4_kms)
|
|
|
|
{
|
|
|
|
DBG("");
|
|
|
|
|
|
|
|
clk_prepare_enable(mdp4_kms->clk);
|
2020-12-31 09:41:55 +00:00
|
|
|
clk_prepare_enable(mdp4_kms->pclk);
|
|
|
|
clk_prepare_enable(mdp4_kms->lut_clk);
|
|
|
|
clk_prepare_enable(mdp4_kms->axi_clk);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
|
|
|
|
int intf_type)
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
{
|
|
|
|
struct drm_device *dev = mdp4_kms->dev;
|
|
|
|
struct msm_drm_private *priv = dev->dev_private;
|
|
|
|
struct drm_encoder *encoder;
|
2014-08-01 13:08:11 -04:00
|
|
|
struct drm_connector *connector;
|
2025-04-25 12:51:56 +03:00
|
|
|
struct drm_bridge *next_bridge;
|
2017-01-16 09:42:03 +05:30
|
|
|
int dsi_id;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
int ret;
|
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
switch (intf_type) {
|
|
|
|
case DRM_MODE_ENCODER_LVDS:
|
2015-11-18 17:15:50 +05:30
|
|
|
/*
|
2016-09-13 20:51:34 +05:30
|
|
|
* bail out early if there is no panel node (no need to
|
|
|
|
* initialize LCDC encoder and LVDS connector)
|
2015-11-18 17:15:50 +05:30
|
|
|
*/
|
2025-04-25 12:51:56 +03:00
|
|
|
next_bridge = devm_drm_of_get_bridge(dev->dev, dev->dev->of_node, 0, 0);
|
|
|
|
if (IS_ERR(next_bridge)) {
|
|
|
|
ret = PTR_ERR(next_bridge);
|
|
|
|
if (ret == -ENODEV)
|
|
|
|
return 0;
|
|
|
|
return ret;
|
|
|
|
}
|
2015-11-18 17:15:50 +05:30
|
|
|
|
2025-04-25 12:51:56 +03:00
|
|
|
encoder = mdp4_lcdc_encoder_init(dev);
|
2015-10-19 12:20:52 +05:30
|
|
|
if (IS_ERR(encoder)) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to construct LCDC encoder\n");
|
2015-10-19 12:20:52 +05:30
|
|
|
return PTR_ERR(encoder);
|
|
|
|
}
|
2013-10-08 12:57:48 -04:00
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
/* LCDC can be hooked to DMA_P (TODO: Add DMA_S later?) */
|
|
|
|
encoder->possible_crtcs = 1 << DMA_P;
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2025-04-25 12:51:56 +03:00
|
|
|
ret = drm_bridge_attach(encoder, next_bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
|
|
|
|
if (ret) {
|
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to attach LVDS panel/bridge: %d\n", ret);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
connector = drm_bridge_connector_init(dev, encoder);
|
2015-10-19 12:20:52 +05:30
|
|
|
if (IS_ERR(connector)) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n");
|
2015-10-19 12:20:52 +05:30
|
|
|
return PTR_ERR(connector);
|
|
|
|
}
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2025-04-25 12:51:56 +03:00
|
|
|
ret = drm_connector_attach_encoder(connector, encoder);
|
|
|
|
if (ret) {
|
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to attach LVDS connector: %d\n", ret);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
break;
|
|
|
|
case DRM_MODE_ENCODER_TMDS:
|
|
|
|
encoder = mdp4_dtv_encoder_init(dev);
|
|
|
|
if (IS_ERR(encoder)) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to construct DTV encoder\n");
|
2015-10-19 12:20:52 +05:30
|
|
|
return PTR_ERR(encoder);
|
|
|
|
}
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
/* DTV can be hooked to DMA_E: */
|
|
|
|
encoder->possible_crtcs = 1 << 1;
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2025-07-05 13:02:30 +03:00
|
|
|
if (priv->kms->hdmi) {
|
2015-10-19 12:20:52 +05:30
|
|
|
/* Construct bridge/connector for HDMI: */
|
2025-07-05 13:02:30 +03:00
|
|
|
ret = msm_hdmi_modeset_init(priv->kms->hdmi, dev, encoder);
|
2015-10-19 12:20:52 +05:30
|
|
|
if (ret) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to initialize HDMI: %d\n", ret);
|
2015-10-19 12:20:52 +05:30
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2015-11-18 17:58:28 +05:30
|
|
|
break;
|
|
|
|
case DRM_MODE_ENCODER_DSI:
|
|
|
|
/* only DSI1 supported for now */
|
|
|
|
dsi_id = 0;
|
|
|
|
|
2025-07-05 13:02:30 +03:00
|
|
|
if (!priv->kms->dsi[dsi_id])
|
2015-11-18 17:58:28 +05:30
|
|
|
break;
|
|
|
|
|
2017-01-16 09:42:03 +05:30
|
|
|
encoder = mdp4_dsi_encoder_init(dev);
|
|
|
|
if (IS_ERR(encoder)) {
|
|
|
|
ret = PTR_ERR(encoder);
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev,
|
2017-01-16 09:42:03 +05:30
|
|
|
"failed to construct DSI encoder: %d\n", ret);
|
|
|
|
return ret;
|
2015-11-18 17:58:28 +05:30
|
|
|
}
|
|
|
|
|
2017-01-16 09:42:03 +05:30
|
|
|
/* TODO: Add DMA_S later? */
|
|
|
|
encoder->possible_crtcs = 1 << DMA_P;
|
|
|
|
|
2025-07-05 13:02:30 +03:00
|
|
|
ret = msm_dsi_modeset_init(priv->kms->dsi[dsi_id], dev, encoder);
|
2015-11-18 17:58:28 +05:30
|
|
|
if (ret) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to initialize DSI: %d\n",
|
2015-11-18 17:58:28 +05:30
|
|
|
ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
break;
|
|
|
|
default:
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "Invalid or unsupported interface\n");
|
2015-10-19 12:20:52 +05:30
|
|
|
return -EINVAL;
|
2014-08-01 13:08:11 -04:00
|
|
|
}
|
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
return 0;
|
|
|
|
}
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
static int modeset_init(struct mdp4_kms *mdp4_kms)
|
|
|
|
{
|
|
|
|
struct drm_device *dev = mdp4_kms->dev;
|
|
|
|
struct drm_plane *plane;
|
|
|
|
struct drm_crtc *crtc;
|
|
|
|
int i, ret;
|
|
|
|
static const enum mdp4_pipe rgb_planes[] = {
|
|
|
|
RGB1, RGB2,
|
|
|
|
};
|
|
|
|
static const enum mdp4_pipe vg_planes[] = {
|
|
|
|
VG1, VG2,
|
|
|
|
};
|
|
|
|
static const enum mdp4_dma mdp4_crtcs[] = {
|
|
|
|
DMA_P, DMA_E,
|
|
|
|
};
|
|
|
|
static const char * const mdp4_crtc_names[] = {
|
|
|
|
"DMA_P", "DMA_E",
|
|
|
|
};
|
|
|
|
static const int mdp4_intfs[] = {
|
|
|
|
DRM_MODE_ENCODER_LVDS,
|
2015-11-18 17:58:28 +05:30
|
|
|
DRM_MODE_ENCODER_DSI,
|
2015-10-19 12:20:52 +05:30
|
|
|
DRM_MODE_ENCODER_TMDS,
|
|
|
|
};
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
/* construct non-private planes: */
|
|
|
|
for (i = 0; i < ARRAY_SIZE(vg_planes); i++) {
|
|
|
|
plane = mdp4_plane_init(dev, vg_planes[i], false);
|
|
|
|
if (IS_ERR(plane)) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev,
|
2015-10-19 12:20:52 +05:30
|
|
|
"failed to construct plane for VG%d\n", i + 1);
|
|
|
|
ret = PTR_ERR(plane);
|
|
|
|
goto fail;
|
|
|
|
}
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
}
|
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
for (i = 0; i < ARRAY_SIZE(mdp4_crtcs); i++) {
|
|
|
|
plane = mdp4_plane_init(dev, rgb_planes[i], true);
|
|
|
|
if (IS_ERR(plane)) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev,
|
2015-10-19 12:20:52 +05:30
|
|
|
"failed to construct plane for RGB%d\n", i + 1);
|
|
|
|
ret = PTR_ERR(plane);
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2025-07-05 13:02:28 +03:00
|
|
|
crtc = mdp4_crtc_init(dev, plane, i,
|
2015-10-19 12:20:52 +05:30
|
|
|
mdp4_crtcs[i]);
|
|
|
|
if (IS_ERR(crtc)) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to construct crtc for %s\n",
|
2015-10-19 12:20:52 +05:30
|
|
|
mdp4_crtc_names[i]);
|
|
|
|
ret = PTR_ERR(crtc);
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
}
|
2014-08-01 13:08:11 -04:00
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
/*
|
|
|
|
* we currently set up two relatively fixed paths:
|
|
|
|
*
|
|
|
|
* LCDC/LVDS path: RGB1 -> DMA_P -> LCDC -> LVDS
|
2015-11-18 17:58:28 +05:30
|
|
|
* or
|
|
|
|
* DSI path: RGB1 -> DMA_P -> DSI1 -> DSI Panel
|
|
|
|
*
|
2015-10-19 12:20:52 +05:30
|
|
|
* DTV/HDMI path: RGB2 -> DMA_E -> DTV -> HDMI
|
|
|
|
*/
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
2015-10-19 12:20:52 +05:30
|
|
|
for (i = 0; i < ARRAY_SIZE(mdp4_intfs); i++) {
|
|
|
|
ret = mdp4_modeset_init_intf(mdp4_kms, mdp4_intfs[i]);
|
2014-11-04 13:33:14 -05:00
|
|
|
if (ret) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to initialize intf: %d, %d\n",
|
2015-10-19 12:20:52 +05:30
|
|
|
i, ret);
|
2014-11-04 13:33:14 -05:00
|
|
|
goto fail;
|
|
|
|
}
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
fail:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2021-07-06 01:16:40 +02:00
|
|
|
static void read_mdp_hw_revision(struct mdp4_kms *mdp4_kms,
|
|
|
|
u32 *major, u32 *minor)
|
|
|
|
{
|
|
|
|
struct drm_device *dev = mdp4_kms->dev;
|
|
|
|
u32 version;
|
|
|
|
|
|
|
|
mdp4_enable(mdp4_kms);
|
|
|
|
version = mdp4_read(mdp4_kms, REG_MDP4_VERSION);
|
|
|
|
mdp4_disable(mdp4_kms);
|
|
|
|
|
|
|
|
*major = FIELD(version, MDP4_VERSION_MAJOR);
|
|
|
|
*minor = FIELD(version, MDP4_VERSION_MINOR);
|
|
|
|
|
|
|
|
DRM_DEV_INFO(dev->dev, "MDP4 version v%d.%d", *major, *minor);
|
|
|
|
}
|
|
|
|
|
2022-04-19 18:53:44 +03:00
|
|
|
static int mdp4_kms_init(struct drm_device *dev)
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
{
|
2016-12-18 00:01:19 +02:00
|
|
|
struct platform_device *pdev = to_platform_device(dev->dev);
|
2021-08-11 19:06:31 +02:00
|
|
|
struct msm_drm_private *priv = dev->dev_private;
|
2023-10-09 20:48:39 +03:00
|
|
|
struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(priv->kms));
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
struct msm_kms *kms = NULL;
|
2022-11-02 20:54:48 +03:00
|
|
|
struct msm_mmu *mmu;
|
2025-06-29 13:12:58 -07:00
|
|
|
struct drm_gpuvm *vm;
|
2023-10-09 20:48:39 +03:00
|
|
|
int ret;
|
2021-07-06 01:16:41 +02:00
|
|
|
u32 major, minor;
|
2022-05-05 16:50:08 +03:00
|
|
|
unsigned long max_clk;
|
|
|
|
|
|
|
|
/* TODO: Chips that aren't apq8064 have a 200 Mhz max_clk */
|
|
|
|
max_clk = 266667000;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
2020-10-19 14:10:52 -07:00
|
|
|
ret = mdp_kms_init(&mdp4_kms->base, &kms_funcs);
|
|
|
|
if (ret) {
|
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to init kms\n");
|
|
|
|
goto fail;
|
|
|
|
}
|
2013-11-30 17:24:22 -05:00
|
|
|
|
2021-08-11 19:06:31 +02:00
|
|
|
kms = priv->kms;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
|
|
|
mdp4_kms->dev = dev;
|
|
|
|
|
|
|
|
if (mdp4_kms->vdd) {
|
|
|
|
ret = regulator_enable(mdp4_kms->vdd);
|
|
|
|
if (ret) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to enable regulator vdd: %d\n", ret);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-05 16:50:08 +03:00
|
|
|
clk_set_rate(mdp4_kms->clk, max_clk);
|
2021-07-06 01:16:41 +02:00
|
|
|
|
|
|
|
read_mdp_hw_revision(mdp4_kms, &major, &minor);
|
|
|
|
|
|
|
|
if (major != 4) {
|
|
|
|
DRM_DEV_ERROR(dev->dev, "unexpected MDP version: v%d.%d\n",
|
|
|
|
major, minor);
|
|
|
|
ret = -ENXIO;
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
mdp4_kms->rev = minor;
|
|
|
|
|
|
|
|
if (mdp4_kms->rev >= 2) {
|
2023-10-09 20:48:39 +03:00
|
|
|
if (!mdp4_kms->lut_clk) {
|
2021-07-06 01:16:41 +02:00
|
|
|
DRM_DEV_ERROR(dev->dev, "failed to get lut_clk\n");
|
2023-10-09 20:48:39 +03:00
|
|
|
ret = -ENODEV;
|
2021-07-06 01:16:41 +02:00
|
|
|
goto fail;
|
|
|
|
}
|
2022-05-05 16:50:08 +03:00
|
|
|
clk_set_rate(mdp4_kms->lut_clk, max_clk);
|
2021-07-06 01:16:41 +02:00
|
|
|
}
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
2016-06-15 18:04:31 +05:30
|
|
|
pm_runtime_enable(dev->dev);
|
|
|
|
mdp4_kms->rpm_enabled = true;
|
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
/* make sure things are off before attaching iommu (bootloader could
|
|
|
|
* have left things on, in which case we'll start getting faults if
|
|
|
|
* we don't disable):
|
|
|
|
*/
|
2013-11-16 13:07:31 -05:00
|
|
|
mdp4_enable(mdp4_kms);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_DTV_ENABLE, 0);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_LCDC_ENABLE, 0);
|
|
|
|
mdp4_write(mdp4_kms, REG_MDP4_DSI_ENABLE, 0);
|
2013-11-16 13:07:31 -05:00
|
|
|
mdp4_disable(mdp4_kms);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
mdelay(16);
|
|
|
|
|
2022-11-02 20:54:48 +03:00
|
|
|
mmu = msm_iommu_new(&pdev->dev, 0);
|
|
|
|
if (IS_ERR(mmu)) {
|
|
|
|
ret = PTR_ERR(mmu);
|
|
|
|
goto fail;
|
|
|
|
} else if (!mmu) {
|
|
|
|
DRM_DEV_INFO(dev->dev, "no iommu, fallback to phys "
|
|
|
|
"contig buffers for scanout\n");
|
2025-06-29 13:12:49 -07:00
|
|
|
vm = NULL;
|
2022-11-02 20:54:48 +03:00
|
|
|
} else {
|
2025-06-29 13:12:56 -07:00
|
|
|
vm = msm_gem_vm_create(dev, mmu, "mdp4",
|
|
|
|
0x1000, 0x100000000 - 0x1000,
|
|
|
|
true);
|
2020-05-22 16:03:15 -06:00
|
|
|
|
2025-06-29 13:12:49 -07:00
|
|
|
if (IS_ERR(vm)) {
|
2020-05-22 16:03:15 -06:00
|
|
|
if (!IS_ERR(mmu))
|
|
|
|
mmu->funcs->destroy(mmu);
|
2025-06-29 13:12:49 -07:00
|
|
|
ret = PTR_ERR(vm);
|
2013-11-16 12:56:06 -05:00
|
|
|
goto fail;
|
|
|
|
}
|
2016-09-28 19:58:32 -04:00
|
|
|
|
2025-06-29 13:12:49 -07:00
|
|
|
kms->vm = vm;
|
2013-11-16 12:56:06 -05:00
|
|
|
}
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
|
|
|
ret = modeset_init(mdp4_kms);
|
|
|
|
if (ret) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "modeset_init failed: %d\n", ret);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2018-11-21 20:52:28 -05:00
|
|
|
mdp4_kms->blank_cursor_bo = msm_gem_new(dev, SZ_16K, MSM_BO_WC | MSM_BO_SCANOUT);
|
2014-04-22 12:27:28 -04:00
|
|
|
if (IS_ERR(mdp4_kms->blank_cursor_bo)) {
|
|
|
|
ret = PTR_ERR(mdp4_kms->blank_cursor_bo);
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "could not allocate blank-cursor bo: %d\n", ret);
|
2014-04-22 12:27:28 -04:00
|
|
|
mdp4_kms->blank_cursor_bo = NULL;
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2025-06-29 13:12:49 -07:00
|
|
|
ret = msm_gem_get_and_pin_iova(mdp4_kms->blank_cursor_bo, kms->vm,
|
2014-04-22 12:27:28 -04:00
|
|
|
&mdp4_kms->blank_cursor_iova);
|
|
|
|
if (ret) {
|
2018-10-20 23:19:26 +05:30
|
|
|
DRM_DEV_ERROR(dev->dev, "could not pin blank-cursor bo: %d\n", ret);
|
2014-04-22 12:27:28 -04:00
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2015-06-24 19:13:40 -04:00
|
|
|
dev->mode_config.min_width = 0;
|
|
|
|
dev->mode_config.min_height = 0;
|
|
|
|
dev->mode_config.max_width = 2048;
|
|
|
|
dev->mode_config.max_height = 2048;
|
|
|
|
|
2022-04-19 18:53:44 +03:00
|
|
|
return 0;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
|
|
|
|
fail:
|
|
|
|
if (kms)
|
|
|
|
mdp4_destroy(kms);
|
2022-04-19 18:53:44 +03:00
|
|
|
|
|
|
|
return ret;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-26 12:44:06 -04:00
|
|
|
}
|
|
|
|
|
2022-04-19 18:53:43 +03:00
|
|
|
static const struct dev_pm_ops mdp4_pm_ops = {
|
2023-10-09 21:10:34 +03:00
|
|
|
.prepare = msm_kms_pm_prepare,
|
|
|
|
.complete = msm_kms_pm_complete,
|
2022-04-19 18:53:43 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static int mdp4_probe(struct platform_device *pdev)
|
|
|
|
{
|
2023-10-09 20:48:39 +03:00
|
|
|
struct device *dev = &pdev->dev;
|
|
|
|
struct mdp4_kms *mdp4_kms;
|
|
|
|
int irq;
|
|
|
|
|
|
|
|
mdp4_kms = devm_kzalloc(dev, sizeof(*mdp4_kms), GFP_KERNEL);
|
|
|
|
if (!mdp4_kms)
|
|
|
|
return dev_err_probe(dev, -ENOMEM, "failed to allocate kms\n");
|
|
|
|
|
|
|
|
mdp4_kms->mmio = msm_ioremap(pdev, NULL);
|
|
|
|
if (IS_ERR(mdp4_kms->mmio))
|
|
|
|
return PTR_ERR(mdp4_kms->mmio);
|
|
|
|
|
|
|
|
irq = platform_get_irq(pdev, 0);
|
|
|
|
if (irq < 0)
|
|
|
|
return dev_err_probe(dev, irq, "failed to get irq\n");
|
|
|
|
|
|
|
|
mdp4_kms->base.base.irq = irq;
|
|
|
|
|
|
|
|
/* NOTE: driver for this regulator still missing upstream.. use
|
|
|
|
* _get_exclusive() and ignore the error if it does not exist
|
|
|
|
* (and hope that the bootloader left it on for us)
|
|
|
|
*/
|
|
|
|
mdp4_kms->vdd = devm_regulator_get_exclusive(&pdev->dev, "vdd");
|
|
|
|
if (IS_ERR(mdp4_kms->vdd))
|
|
|
|
mdp4_kms->vdd = NULL;
|
|
|
|
|
|
|
|
mdp4_kms->clk = devm_clk_get(&pdev->dev, "core_clk");
|
|
|
|
if (IS_ERR(mdp4_kms->clk))
|
|
|
|
return dev_err_probe(dev, PTR_ERR(mdp4_kms->clk), "failed to get core_clk\n");
|
|
|
|
|
|
|
|
mdp4_kms->pclk = devm_clk_get(&pdev->dev, "iface_clk");
|
|
|
|
if (IS_ERR(mdp4_kms->pclk))
|
|
|
|
mdp4_kms->pclk = NULL;
|
|
|
|
|
|
|
|
mdp4_kms->axi_clk = devm_clk_get(&pdev->dev, "bus_clk");
|
|
|
|
if (IS_ERR(mdp4_kms->axi_clk))
|
|
|
|
return dev_err_probe(dev, PTR_ERR(mdp4_kms->axi_clk), "failed to get axi_clk\n");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is required for revn >= 2. Handle errors here and let the kms
|
|
|
|
* init bail out if the clock is not provided.
|
|
|
|
*/
|
|
|
|
mdp4_kms->lut_clk = devm_clk_get_optional(&pdev->dev, "lut_clk");
|
|
|
|
if (IS_ERR(mdp4_kms->lut_clk))
|
|
|
|
return dev_err_probe(dev, PTR_ERR(mdp4_kms->lut_clk), "failed to get lut_clk\n");
|
|
|
|
|
|
|
|
return msm_drv_probe(&pdev->dev, mdp4_kms_init, &mdp4_kms->base.base);
|
2022-04-19 18:53:43 +03:00
|
|
|
}
|
|
|
|
|
2023-05-07 18:25:54 +02:00
|
|
|
static void mdp4_remove(struct platform_device *pdev)
|
2022-04-19 18:53:43 +03:00
|
|
|
{
|
|
|
|
component_master_del(&pdev->dev, &msm_drm_ops);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct of_device_id mdp4_dt_match[] = {
|
2022-04-19 18:53:44 +03:00
|
|
|
{ .compatible = "qcom,mdp4" },
|
2022-04-19 18:53:43 +03:00
|
|
|
{ /* sentinel */ }
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(of, mdp4_dt_match);
|
|
|
|
|
|
|
|
static struct platform_driver mdp4_platform_driver = {
|
|
|
|
.probe = mdp4_probe,
|
2024-12-01 15:12:43 -08:00
|
|
|
.remove = mdp4_remove,
|
2023-10-09 21:10:36 +03:00
|
|
|
.shutdown = msm_kms_shutdown,
|
2022-04-19 18:53:43 +03:00
|
|
|
.driver = {
|
|
|
|
.name = "mdp4",
|
|
|
|
.of_match_table = mdp4_dt_match,
|
|
|
|
.pm = &mdp4_pm_ops,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
void __init msm_mdp4_register(void)
|
|
|
|
{
|
|
|
|
platform_driver_register(&mdp4_platform_driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
void __exit msm_mdp4_unregister(void)
|
|
|
|
{
|
|
|
|
platform_driver_unregister(&mdp4_platform_driver);
|
|
|
|
}
|