提交 c344ee68 编写于 作者: D Dave Airlie

Merge branch 'exynos-drm-next' of...

Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Feature summary:
Add S3C64XX SoC series support - S3C64XX SoC series are previous version
chips of Exynos SoC series. With this patch set, KMS driver of Exynos drm
supports those chips also.

Update device tree support - This patch set corrects compatible strings,
and adds Exynos5420 SoC support for hdmi subsystem.

Consider CCF (Common Clock Framework) support - With reference to CCF
support, it uses clock_prepare_enable/clock_disable_unprepare instead of
clk_enable/clk_disable for hdmi subsystem.

Big cleanups - This patch just removes unnecessary all debug logs.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (22 commits)
  ARM: dts: change compatible strings for EXYNOS5250 hdmi subsystem
  drm/exynos: add support for exynos5420 mixer
  drm/exynos: add new compatible strings for hdmi subsystem
  drm/exynos: fix interlace resolutions for exynos5420
  drm/exynos: use of_get_named_gpio to get hdmi hpd gpio
  drm/exynos: make sure to handle an error case to vm_mmap call
  drm/exynos: exynos_drm_ipp: Remove redundant break statement
  drm/exynos: add mout_hdmi clock in hdmi driver to change parent
  drm/exynos: Prepare/Unprepare HDMI subsystem clocks
  drm/exynos: Clean up logs for DRM_ERROR / DRM_DEBUG_KMS
  drm/exynos: Remove tracking log functions
  drm/exynos: hdmi: use drm_display_mode to check the supported modes
  drm/exynos: fimd: Add support for S3C64xx SoCs
  drm/exynos: fimd: Add support for FIMD variants with clock selection
  drm/exynos: fimd: Add support for FIMD versions without SHADOWCON register
  drm/exynos: fimd: Hold pointer to driver data in context struct
  drm/exynos: do not use mode_set_base function directly
  drm/exynos: Remove redundant use of of_match_ptr macro
  drm/exynos: remove ignoring return value warning in hdmi
  drm/exynos: fix WINDOWS_NR checking to vidi driver
  ...
Device-Tree bindings for drm hdmi driver Device-Tree bindings for drm hdmi driver
Required properties: Required properties:
- compatible: value should be "samsung,exynos5-hdmi". - compatible: value should be one among the following:
1) "samsung,exynos5-hdmi" <DEPRECATED>
2) "samsung,exynos4210-hdmi"
3) "samsung,exynos4212-hdmi"
- reg: physical base address of the hdmi and length of memory mapped - reg: physical base address of the hdmi and length of memory mapped
region. region.
- interrupts: interrupt number to the cpu. - interrupts: interrupt number to the cpu.
...@@ -15,7 +18,7 @@ Required properties: ...@@ -15,7 +18,7 @@ Required properties:
Example: Example:
hdmi { hdmi {
compatible = "samsung,exynos5-hdmi"; compatible = "samsung,exynos4212-hdmi";
reg = <0x14530000 0x100000>; reg = <0x14530000 0x100000>;
interrupts = <0 95 0>; interrupts = <0 95 0>;
hpd-gpio = <&gpx3 7 0xf 1 3>; hpd-gpio = <&gpx3 7 0xf 1 3>;
......
Device-Tree bindings for hdmiddc driver Device-Tree bindings for hdmiddc driver
Required properties: Required properties:
- compatible: value should be "samsung,exynos5-hdmiddc". - compatible: value should be one of the following
1) "samsung,exynos5-hdmiddc" <DEPRECATED>
2) "samsung,exynos4210-hdmiddc"
- reg: I2C address of the hdmiddc device. - reg: I2C address of the hdmiddc device.
Example: Example:
hdmiddc { hdmiddc {
compatible = "samsung,exynos5-hdmiddc"; compatible = "samsung,exynos4210-hdmiddc";
reg = <0x50>; reg = <0x50>;
}; };
Device-Tree bindings for hdmiphy driver Device-Tree bindings for hdmiphy driver
Required properties: Required properties:
- compatible: value should be "samsung,exynos5-hdmiphy". - compatible: value should be one of the following:
1) "samsung,exynos5-hdmiphy" <DEPRECATED>
2) "samsung,exynos4210-hdmiphy".
3) "samsung,exynos4212-hdmiphy".
- reg: I2C address of the hdmiphy device. - reg: I2C address of the hdmiphy device.
Example: Example:
hdmiphy { hdmiphy {
compatible = "samsung,exynos5-hdmiphy"; compatible = "samsung,exynos4210-hdmiphy";
reg = <0x38>; reg = <0x38>;
}; };
Device-Tree bindings for mixer driver Device-Tree bindings for mixer driver
Required properties: Required properties:
- compatible: value should be "samsung,exynos5-mixer". - compatible: value should be one of the following:
1) "samsung,exynos5-mixer" <DEPRECATED>
2) "samsung,exynos4210-mixer"
3) "samsung,exynos5250-mixer"
4) "samsung,exynos5420-mixer"
- reg: physical base address of the mixer and length of memory mapped - reg: physical base address of the mixer and length of memory mapped
region. region.
- interrupts: interrupt number to the cpu. - interrupts: interrupt number to the cpu.
...@@ -9,7 +14,7 @@ Required properties: ...@@ -9,7 +14,7 @@ Required properties:
Example: Example:
mixer { mixer {
compatible = "samsung,exynos5-mixer"; compatible = "samsung,exynos5250-mixer";
reg = <0x14450000 0x10000>; reg = <0x14450000 0x10000>;
interrupts = <0 94 0>; interrupts = <0 94 0>;
}; };
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
samsung,i2c-max-bus-freq = <66000>; samsung,i2c-max-bus-freq = <66000>;
hdmiddc@50 { hdmiddc@50 {
compatible = "samsung,exynos5-hdmiddc"; compatible = "samsung,exynos4210-hdmiddc";
reg = <0x50>; reg = <0x50>;
}; };
}; };
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
samsung,i2c-max-bus-freq = <378000>; samsung,i2c-max-bus-freq = <378000>;
hdmiphy@38 { hdmiphy@38 {
compatible = "samsung,exynos5-hdmiphy"; compatible = "samsung,exynos4212-hdmiphy";
reg = <0x38>; reg = <0x38>;
}; };
}; };
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
samsung,i2c-max-bus-freq = <66000>; samsung,i2c-max-bus-freq = <66000>;
hdmiddc@50 { hdmiddc@50 {
compatible = "samsung,exynos5-hdmiddc"; compatible = "samsung,exynos4210-hdmiddc";
reg = <0x50>; reg = <0x50>;
}; };
}; };
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
samsung,i2c-max-bus-freq = <66000>; samsung,i2c-max-bus-freq = <66000>;
hdmiphy@38 { hdmiphy@38 {
compatible = "samsung,exynos5-hdmiphy"; compatible = "samsung,exynos4212-hdmiphy";
reg = <0x38>; reg = <0x38>;
}; };
}; };
......
...@@ -601,7 +601,7 @@ ...@@ -601,7 +601,7 @@
}; };
hdmi { hdmi {
compatible = "samsung,exynos5-hdmi"; compatible = "samsung,exynos4212-hdmi";
reg = <0x14530000 0x70000>; reg = <0x14530000 0x70000>;
interrupts = <0 95 0>; interrupts = <0 95 0>;
clocks = <&clock 333>, <&clock 136>, <&clock 137>, clocks = <&clock 333>, <&clock 136>, <&clock 137>,
...@@ -611,7 +611,7 @@ ...@@ -611,7 +611,7 @@
}; };
mixer { mixer {
compatible = "samsung,exynos5-mixer"; compatible = "samsung,exynos5250-mixer";
reg = <0x14450000 0x10000>; reg = <0x14450000 0x10000>;
interrupts = <0 94 0>; interrupts = <0 94 0>;
}; };
......
...@@ -52,6 +52,8 @@ static struct i2c_device_id ddc_idtable[] = { ...@@ -52,6 +52,8 @@ static struct i2c_device_id ddc_idtable[] = {
static struct of_device_id hdmiddc_match_types[] = { static struct of_device_id hdmiddc_match_types[] = {
{ {
.compatible = "samsung,exynos5-hdmiddc", .compatible = "samsung,exynos5-hdmiddc",
}, {
.compatible = "samsung,exynos4210-hdmiddc",
}, { }, {
/* end node */ /* end node */
} }
......
...@@ -24,8 +24,6 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, ...@@ -24,8 +24,6 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
enum dma_attr attr; enum dma_attr attr;
unsigned int nr_pages; unsigned int nr_pages;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (buf->dma_addr) { if (buf->dma_addr) {
DRM_DEBUG_KMS("already allocated.\n"); DRM_DEBUG_KMS("already allocated.\n");
return 0; return 0;
...@@ -119,8 +117,6 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, ...@@ -119,8 +117,6 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
static void lowlevel_buffer_deallocate(struct drm_device *dev, static void lowlevel_buffer_deallocate(struct drm_device *dev,
unsigned int flags, struct exynos_drm_gem_buf *buf) unsigned int flags, struct exynos_drm_gem_buf *buf)
{ {
DRM_DEBUG_KMS("%s.\n", __FILE__);
if (!buf->dma_addr) { if (!buf->dma_addr) {
DRM_DEBUG_KMS("dma_addr is invalid.\n"); DRM_DEBUG_KMS("dma_addr is invalid.\n");
return; return;
...@@ -151,7 +147,6 @@ struct exynos_drm_gem_buf *exynos_drm_init_buf(struct drm_device *dev, ...@@ -151,7 +147,6 @@ struct exynos_drm_gem_buf *exynos_drm_init_buf(struct drm_device *dev,
{ {
struct exynos_drm_gem_buf *buffer; struct exynos_drm_gem_buf *buffer;
DRM_DEBUG_KMS("%s.\n", __FILE__);
DRM_DEBUG_KMS("desired size = 0x%x\n", size); DRM_DEBUG_KMS("desired size = 0x%x\n", size);
buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
...@@ -167,8 +162,6 @@ struct exynos_drm_gem_buf *exynos_drm_init_buf(struct drm_device *dev, ...@@ -167,8 +162,6 @@ struct exynos_drm_gem_buf *exynos_drm_init_buf(struct drm_device *dev,
void exynos_drm_fini_buf(struct drm_device *dev, void exynos_drm_fini_buf(struct drm_device *dev,
struct exynos_drm_gem_buf *buffer) struct exynos_drm_gem_buf *buffer)
{ {
DRM_DEBUG_KMS("%s.\n", __FILE__);
if (!buffer) { if (!buffer) {
DRM_DEBUG_KMS("buffer is null.\n"); DRM_DEBUG_KMS("buffer is null.\n");
return; return;
......
...@@ -34,7 +34,6 @@ convert_to_display_mode(struct drm_display_mode *mode, ...@@ -34,7 +34,6 @@ convert_to_display_mode(struct drm_display_mode *mode,
struct exynos_drm_panel_info *panel) struct exynos_drm_panel_info *panel)
{ {
struct fb_videomode *timing = &panel->timing; struct fb_videomode *timing = &panel->timing;
DRM_DEBUG_KMS("%s\n", __FILE__);
mode->clock = timing->pixclock / 1000; mode->clock = timing->pixclock / 1000;
mode->vrefresh = timing->refresh; mode->vrefresh = timing->refresh;
...@@ -58,37 +57,6 @@ convert_to_display_mode(struct drm_display_mode *mode, ...@@ -58,37 +57,6 @@ convert_to_display_mode(struct drm_display_mode *mode,
mode->flags |= DRM_MODE_FLAG_DBLSCAN; mode->flags |= DRM_MODE_FLAG_DBLSCAN;
} }
/* convert drm_display_mode to exynos_video_timings */
static inline void
convert_to_video_timing(struct fb_videomode *timing,
struct drm_display_mode *mode)
{
DRM_DEBUG_KMS("%s\n", __FILE__);
memset(timing, 0, sizeof(*timing));
timing->pixclock = mode->clock * 1000;
timing->refresh = drm_mode_vrefresh(mode);
timing->xres = mode->hdisplay;
timing->right_margin = mode->hsync_start - mode->hdisplay;
timing->hsync_len = mode->hsync_end - mode->hsync_start;
timing->left_margin = mode->htotal - mode->hsync_end;
timing->yres = mode->vdisplay;
timing->lower_margin = mode->vsync_start - mode->vdisplay;
timing->vsync_len = mode->vsync_end - mode->vsync_start;
timing->upper_margin = mode->vtotal - mode->vsync_end;
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
timing->vmode = FB_VMODE_INTERLACED;
else
timing->vmode = FB_VMODE_NONINTERLACED;
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
timing->vmode |= FB_VMODE_DOUBLE;
}
static int exynos_drm_connector_get_modes(struct drm_connector *connector) static int exynos_drm_connector_get_modes(struct drm_connector *connector)
{ {
struct exynos_drm_connector *exynos_connector = struct exynos_drm_connector *exynos_connector =
...@@ -99,8 +67,6 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) ...@@ -99,8 +67,6 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
unsigned int count = 0; unsigned int count = 0;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!display_ops) { if (!display_ops) {
DRM_DEBUG_KMS("display_ops is null.\n"); DRM_DEBUG_KMS("display_ops is null.\n");
return 0; return 0;
...@@ -168,15 +134,12 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector, ...@@ -168,15 +134,12 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector,
to_exynos_connector(connector); to_exynos_connector(connector);
struct exynos_drm_manager *manager = exynos_connector->manager; struct exynos_drm_manager *manager = exynos_connector->manager;
struct exynos_drm_display_ops *display_ops = manager->display_ops; struct exynos_drm_display_ops *display_ops = manager->display_ops;
struct fb_videomode timing;
int ret = MODE_BAD; int ret = MODE_BAD;
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
convert_to_video_timing(&timing, mode); if (display_ops && display_ops->check_mode)
if (!display_ops->check_mode(manager->dev, mode))
if (display_ops && display_ops->check_timing)
if (!display_ops->check_timing(manager->dev, (void *)&timing))
ret = MODE_OK; ret = MODE_OK;
return ret; return ret;
...@@ -190,8 +153,6 @@ struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector) ...@@ -190,8 +153,6 @@ struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector)
struct drm_mode_object *obj; struct drm_mode_object *obj;
struct drm_encoder *encoder; struct drm_encoder *encoder;
DRM_DEBUG_KMS("%s\n", __FILE__);
obj = drm_mode_object_find(dev, exynos_connector->encoder_id, obj = drm_mode_object_find(dev, exynos_connector->encoder_id,
DRM_MODE_OBJECT_ENCODER); DRM_MODE_OBJECT_ENCODER);
if (!obj) { if (!obj) {
...@@ -234,8 +195,6 @@ void exynos_drm_display_power(struct drm_connector *connector, int mode) ...@@ -234,8 +195,6 @@ void exynos_drm_display_power(struct drm_connector *connector, int mode)
static void exynos_drm_connector_dpms(struct drm_connector *connector, static void exynos_drm_connector_dpms(struct drm_connector *connector,
int mode) int mode)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* in case that drm_crtc_helper_set_mode() is called, * in case that drm_crtc_helper_set_mode() is called,
* encoder/crtc->funcs->dpms() will be just returned * encoder/crtc->funcs->dpms() will be just returned
...@@ -282,8 +241,6 @@ exynos_drm_connector_detect(struct drm_connector *connector, bool force) ...@@ -282,8 +241,6 @@ exynos_drm_connector_detect(struct drm_connector *connector, bool force)
manager->display_ops; manager->display_ops;
enum drm_connector_status status = connector_status_disconnected; enum drm_connector_status status = connector_status_disconnected;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (display_ops && display_ops->is_connected) { if (display_ops && display_ops->is_connected) {
if (display_ops->is_connected(manager->dev)) if (display_ops->is_connected(manager->dev))
status = connector_status_connected; status = connector_status_connected;
...@@ -299,8 +256,6 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector) ...@@ -299,8 +256,6 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector)
struct exynos_drm_connector *exynos_connector = struct exynos_drm_connector *exynos_connector =
to_exynos_connector(connector); to_exynos_connector(connector);
DRM_DEBUG_KMS("%s\n", __FILE__);
drm_sysfs_connector_remove(connector); drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector); drm_connector_cleanup(connector);
kfree(exynos_connector); kfree(exynos_connector);
...@@ -322,8 +277,6 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev, ...@@ -322,8 +277,6 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
int type; int type;
int err; int err;
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_connector = kzalloc(sizeof(*exynos_connector), GFP_KERNEL); exynos_connector = kzalloc(sizeof(*exynos_connector), GFP_KERNEL);
if (!exynos_connector) { if (!exynos_connector) {
DRM_ERROR("failed to allocate connector\n"); DRM_ERROR("failed to allocate connector\n");
......
...@@ -27,8 +27,6 @@ static int exynos_drm_create_enc_conn(struct drm_device *dev, ...@@ -27,8 +27,6 @@ static int exynos_drm_create_enc_conn(struct drm_device *dev,
struct drm_connector *connector; struct drm_connector *connector;
int ret; int ret;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
subdrv->manager->dev = subdrv->dev; subdrv->manager->dev = subdrv->dev;
/* create and initialize a encoder for this sub driver. */ /* create and initialize a encoder for this sub driver. */
...@@ -102,8 +100,6 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev, ...@@ -102,8 +100,6 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev,
static void exynos_drm_subdrv_remove(struct drm_device *dev, static void exynos_drm_subdrv_remove(struct drm_device *dev,
struct exynos_drm_subdrv *subdrv) struct exynos_drm_subdrv *subdrv)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (subdrv->remove) if (subdrv->remove)
subdrv->remove(dev, subdrv->dev); subdrv->remove(dev, subdrv->dev);
} }
...@@ -114,8 +110,6 @@ int exynos_drm_device_register(struct drm_device *dev) ...@@ -114,8 +110,6 @@ int exynos_drm_device_register(struct drm_device *dev)
unsigned int fine_cnt = 0; unsigned int fine_cnt = 0;
int err; int err;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!dev) if (!dev)
return -EINVAL; return -EINVAL;
...@@ -158,8 +152,6 @@ int exynos_drm_device_unregister(struct drm_device *dev) ...@@ -158,8 +152,6 @@ int exynos_drm_device_unregister(struct drm_device *dev)
{ {
struct exynos_drm_subdrv *subdrv; struct exynos_drm_subdrv *subdrv;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!dev) { if (!dev) {
WARN(1, "Unexpected drm device unregister!\n"); WARN(1, "Unexpected drm device unregister!\n");
return -EINVAL; return -EINVAL;
...@@ -176,8 +168,6 @@ EXPORT_SYMBOL_GPL(exynos_drm_device_unregister); ...@@ -176,8 +168,6 @@ EXPORT_SYMBOL_GPL(exynos_drm_device_unregister);
int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!subdrv) if (!subdrv)
return -EINVAL; return -EINVAL;
...@@ -189,8 +179,6 @@ EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register); ...@@ -189,8 +179,6 @@ EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register);
int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv) int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!subdrv) if (!subdrv)
return -EINVAL; return -EINVAL;
......
...@@ -76,8 +76,6 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) ...@@ -76,8 +76,6 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
static void exynos_drm_crtc_prepare(struct drm_crtc *crtc) static void exynos_drm_crtc_prepare(struct drm_crtc *crtc)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* drm framework doesn't check NULL. */ /* drm framework doesn't check NULL. */
} }
...@@ -85,8 +83,6 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc) ...@@ -85,8 +83,6 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc)
{ {
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_ON); exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
exynos_plane_commit(exynos_crtc->plane); exynos_plane_commit(exynos_crtc->plane);
exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_ON); exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_ON);
...@@ -97,8 +93,6 @@ exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc, ...@@ -97,8 +93,6 @@ exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode, const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* drm framework doesn't check NULL */ /* drm framework doesn't check NULL */
return true; return true;
} }
...@@ -115,8 +109,6 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, ...@@ -115,8 +109,6 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
int pipe = exynos_crtc->pipe; int pipe = exynos_crtc->pipe;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* copy the mode data adjusted by mode_fixup() into crtc->mode * copy the mode data adjusted by mode_fixup() into crtc->mode
* so that hardware can be seet to proper mode. * so that hardware can be seet to proper mode.
...@@ -139,7 +131,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, ...@@ -139,7 +131,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
return 0; return 0;
} }
static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, static int exynos_drm_crtc_mode_set_commit(struct drm_crtc *crtc, int x, int y,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
...@@ -148,8 +140,6 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, ...@@ -148,8 +140,6 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
unsigned int crtc_h; unsigned int crtc_h;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* when framebuffer changing is requested, crtc's dpms should be on */ /* when framebuffer changing is requested, crtc's dpms should be on */
if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) {
DRM_ERROR("failed framebuffer changing request.\n"); DRM_ERROR("failed framebuffer changing request.\n");
...@@ -169,12 +159,16 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, ...@@ -169,12 +159,16 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
return 0; return 0;
} }
static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
struct drm_framebuffer *old_fb)
{
return exynos_drm_crtc_mode_set_commit(crtc, x, y, old_fb);
}
static void exynos_drm_crtc_disable(struct drm_crtc *crtc) static void exynos_drm_crtc_disable(struct drm_crtc *crtc)
{ {
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_OFF); exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_OFF);
exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
} }
...@@ -199,8 +193,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, ...@@ -199,8 +193,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *old_fb = crtc->fb; struct drm_framebuffer *old_fb = crtc->fb;
int ret = -EINVAL; int ret = -EINVAL;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* when the page flip is requested, crtc's dpms should be on */ /* when the page flip is requested, crtc's dpms should be on */
if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) {
DRM_ERROR("failed page flip request.\n"); DRM_ERROR("failed page flip request.\n");
...@@ -230,7 +222,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, ...@@ -230,7 +222,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
spin_unlock_irq(&dev->event_lock); spin_unlock_irq(&dev->event_lock);
crtc->fb = fb; crtc->fb = fb;
ret = exynos_drm_crtc_mode_set_base(crtc, crtc->x, crtc->y, ret = exynos_drm_crtc_mode_set_commit(crtc, crtc->x, crtc->y,
NULL); NULL);
if (ret) { if (ret) {
crtc->fb = old_fb; crtc->fb = old_fb;
...@@ -253,8 +245,6 @@ static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) ...@@ -253,8 +245,6 @@ static void exynos_drm_crtc_destroy(struct drm_crtc *crtc)
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
struct exynos_drm_private *private = crtc->dev->dev_private; struct exynos_drm_private *private = crtc->dev->dev_private;
DRM_DEBUG_KMS("%s\n", __FILE__);
private->crtc[exynos_crtc->pipe] = NULL; private->crtc[exynos_crtc->pipe] = NULL;
drm_crtc_cleanup(crtc); drm_crtc_cleanup(crtc);
...@@ -269,8 +259,6 @@ static int exynos_drm_crtc_set_property(struct drm_crtc *crtc, ...@@ -269,8 +259,6 @@ static int exynos_drm_crtc_set_property(struct drm_crtc *crtc,
struct exynos_drm_private *dev_priv = dev->dev_private; struct exynos_drm_private *dev_priv = dev->dev_private;
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
DRM_DEBUG_KMS("%s\n", __func__);
if (property == dev_priv->crtc_mode_property) { if (property == dev_priv->crtc_mode_property) {
enum exynos_crtc_mode mode = val; enum exynos_crtc_mode mode = val;
...@@ -315,8 +303,6 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc) ...@@ -315,8 +303,6 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)
struct exynos_drm_private *dev_priv = dev->dev_private; struct exynos_drm_private *dev_priv = dev->dev_private;
struct drm_property *prop; struct drm_property *prop;
DRM_DEBUG_KMS("%s\n", __func__);
prop = dev_priv->crtc_mode_property; prop = dev_priv->crtc_mode_property;
if (!prop) { if (!prop) {
prop = drm_property_create_enum(dev, 0, "mode", mode_names, prop = drm_property_create_enum(dev, 0, "mode", mode_names,
...@@ -336,8 +322,6 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr) ...@@ -336,8 +322,6 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr)
struct exynos_drm_private *private = dev->dev_private; struct exynos_drm_private *private = dev->dev_private;
struct drm_crtc *crtc; struct drm_crtc *crtc;
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_crtc = kzalloc(sizeof(*exynos_crtc), GFP_KERNEL); exynos_crtc = kzalloc(sizeof(*exynos_crtc), GFP_KERNEL);
if (!exynos_crtc) { if (!exynos_crtc) {
DRM_ERROR("failed to allocate exynos crtc\n"); DRM_ERROR("failed to allocate exynos crtc\n");
...@@ -372,8 +356,6 @@ int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int crtc) ...@@ -372,8 +356,6 @@ int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int crtc)
struct exynos_drm_crtc *exynos_crtc = struct exynos_drm_crtc *exynos_crtc =
to_exynos_crtc(private->crtc[crtc]); to_exynos_crtc(private->crtc[crtc]);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (exynos_crtc->dpms != DRM_MODE_DPMS_ON) if (exynos_crtc->dpms != DRM_MODE_DPMS_ON)
return -EPERM; return -EPERM;
...@@ -389,8 +371,6 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc) ...@@ -389,8 +371,6 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
struct exynos_drm_crtc *exynos_crtc = struct exynos_drm_crtc *exynos_crtc =
to_exynos_crtc(private->crtc[crtc]); to_exynos_crtc(private->crtc[crtc]);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (exynos_crtc->dpms != DRM_MODE_DPMS_ON) if (exynos_crtc->dpms != DRM_MODE_DPMS_ON)
return; return;
...@@ -406,8 +386,6 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc) ...@@ -406,8 +386,6 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc)
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
unsigned long flags; unsigned long flags;
DRM_DEBUG_KMS("%s\n", __FILE__);
spin_lock_irqsave(&dev->event_lock, flags); spin_lock_irqsave(&dev->event_lock, flags);
list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list, list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
......
...@@ -71,8 +71,6 @@ static struct sg_table * ...@@ -71,8 +71,6 @@ static struct sg_table *
unsigned int i; unsigned int i;
int nents, ret; int nents, ret;
DRM_DEBUG_PRIME("%s\n", __FILE__);
/* just return current sgt if already requested. */ /* just return current sgt if already requested. */
if (exynos_attach->dir == dir && exynos_attach->is_mapped) if (exynos_attach->dir == dir && exynos_attach->is_mapped)
return &exynos_attach->sgt; return &exynos_attach->sgt;
...@@ -133,8 +131,6 @@ static void exynos_dmabuf_release(struct dma_buf *dmabuf) ...@@ -133,8 +131,6 @@ static void exynos_dmabuf_release(struct dma_buf *dmabuf)
{ {
struct exynos_drm_gem_obj *exynos_gem_obj = dmabuf->priv; struct exynos_drm_gem_obj *exynos_gem_obj = dmabuf->priv;
DRM_DEBUG_PRIME("%s\n", __FILE__);
/* /*
* exynos_dmabuf_release() call means that file object's * exynos_dmabuf_release() call means that file object's
* f_count is 0 and it calls drm_gem_object_handle_unreference() * f_count is 0 and it calls drm_gem_object_handle_unreference()
...@@ -219,8 +215,6 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, ...@@ -219,8 +215,6 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
struct exynos_drm_gem_buf *buffer; struct exynos_drm_gem_buf *buffer;
int ret; int ret;
DRM_DEBUG_PRIME("%s\n", __FILE__);
/* is this one of own objects? */ /* is this one of own objects? */
if (dma_buf->ops == &exynos_dmabuf_ops) { if (dma_buf->ops == &exynos_dmabuf_ops) {
struct drm_gem_object *obj; struct drm_gem_object *obj;
......
...@@ -46,8 +46,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -46,8 +46,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
int ret; int ret;
int nr; int nr;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL); private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL);
if (!private) { if (!private) {
DRM_ERROR("failed to allocate private\n"); DRM_ERROR("failed to allocate private\n");
...@@ -140,8 +138,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -140,8 +138,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
static int exynos_drm_unload(struct drm_device *dev) static int exynos_drm_unload(struct drm_device *dev)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
exynos_drm_fbdev_fini(dev); exynos_drm_fbdev_fini(dev);
exynos_drm_device_unregister(dev); exynos_drm_device_unregister(dev);
drm_vblank_cleanup(dev); drm_vblank_cleanup(dev);
...@@ -160,8 +156,6 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) ...@@ -160,8 +156,6 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
{ {
struct drm_exynos_file_private *file_priv; struct drm_exynos_file_private *file_priv;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
if (!file_priv) if (!file_priv)
return -ENOMEM; return -ENOMEM;
...@@ -178,8 +172,6 @@ static void exynos_drm_preclose(struct drm_device *dev, ...@@ -178,8 +172,6 @@ static void exynos_drm_preclose(struct drm_device *dev,
struct drm_pending_vblank_event *e, *t; struct drm_pending_vblank_event *e, *t;
unsigned long flags; unsigned long flags;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
/* release events of current file */ /* release events of current file */
spin_lock_irqsave(&dev->event_lock, flags); spin_lock_irqsave(&dev->event_lock, flags);
list_for_each_entry_safe(e, t, &private->pageflip_event_list, list_for_each_entry_safe(e, t, &private->pageflip_event_list,
...@@ -196,8 +188,6 @@ static void exynos_drm_preclose(struct drm_device *dev, ...@@ -196,8 +188,6 @@ static void exynos_drm_preclose(struct drm_device *dev,
static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file) static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!file->driver_priv) if (!file->driver_priv)
return; return;
...@@ -207,8 +197,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file) ...@@ -207,8 +197,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
static void exynos_drm_lastclose(struct drm_device *dev) static void exynos_drm_lastclose(struct drm_device *dev)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
exynos_drm_fbdev_restore_mode(dev); exynos_drm_fbdev_restore_mode(dev);
} }
...@@ -292,8 +280,6 @@ static struct drm_driver exynos_drm_driver = { ...@@ -292,8 +280,6 @@ static struct drm_driver exynos_drm_driver = {
static int exynos_drm_platform_probe(struct platform_device *pdev) static int exynos_drm_platform_probe(struct platform_device *pdev)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls); exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls);
...@@ -302,8 +288,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) ...@@ -302,8 +288,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
static int exynos_drm_platform_remove(struct platform_device *pdev) static int exynos_drm_platform_remove(struct platform_device *pdev)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
drm_platform_exit(&exynos_drm_driver, pdev); drm_platform_exit(&exynos_drm_driver, pdev);
return 0; return 0;
...@@ -322,8 +306,6 @@ static int __init exynos_drm_init(void) ...@@ -322,8 +306,6 @@ static int __init exynos_drm_init(void)
{ {
int ret; int ret;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
#ifdef CONFIG_DRM_EXYNOS_FIMD #ifdef CONFIG_DRM_EXYNOS_FIMD
ret = platform_driver_register(&fimd_driver); ret = platform_driver_register(&fimd_driver);
if (ret < 0) if (ret < 0)
...@@ -455,8 +437,6 @@ static int __init exynos_drm_init(void) ...@@ -455,8 +437,6 @@ static int __init exynos_drm_init(void)
static void __exit exynos_drm_exit(void) static void __exit exynos_drm_exit(void)
{ {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
platform_device_unregister(exynos_drm_pdev); platform_device_unregister(exynos_drm_pdev);
platform_driver_unregister(&exynos_drm_platform_driver); platform_driver_unregister(&exynos_drm_platform_driver);
......
...@@ -142,7 +142,7 @@ struct exynos_drm_overlay { ...@@ -142,7 +142,7 @@ struct exynos_drm_overlay {
* @is_connected: check for that display is connected or not. * @is_connected: check for that display is connected or not.
* @get_edid: get edid modes from display driver. * @get_edid: get edid modes from display driver.
* @get_panel: get panel object from display driver. * @get_panel: get panel object from display driver.
* @check_timing: check if timing is valid or not. * @check_mode: check if mode is valid or not.
* @power_on: display device on or off. * @power_on: display device on or off.
*/ */
struct exynos_drm_display_ops { struct exynos_drm_display_ops {
...@@ -151,7 +151,7 @@ struct exynos_drm_display_ops { ...@@ -151,7 +151,7 @@ struct exynos_drm_display_ops {
struct edid *(*get_edid)(struct device *dev, struct edid *(*get_edid)(struct device *dev,
struct drm_connector *connector); struct drm_connector *connector);
void *(*get_panel)(struct device *dev); void *(*get_panel)(struct device *dev);
int (*check_timing)(struct device *dev, void *timing); int (*check_mode)(struct device *dev, struct drm_display_mode *mode);
int (*power_on)(struct device *dev, int mode); int (*power_on)(struct device *dev, int mode);
}; };
......
...@@ -61,7 +61,7 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) ...@@ -61,7 +61,7 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
struct exynos_drm_manager_ops *manager_ops = manager->ops; struct exynos_drm_manager_ops *manager_ops = manager->ops;
struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
DRM_DEBUG_KMS("%s, encoder dpms: %d\n", __FILE__, mode); DRM_DEBUG_KMS("encoder dpms: %d\n", mode);
if (exynos_encoder->dpms == mode) { if (exynos_encoder->dpms == mode) {
DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n"); DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n");
...@@ -104,8 +104,6 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder, ...@@ -104,8 +104,6 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,
struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
struct exynos_drm_manager_ops *manager_ops = manager->ops; struct exynos_drm_manager_ops *manager_ops = manager->ops;
DRM_DEBUG_KMS("%s\n", __FILE__);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) if (connector->encoder == encoder)
if (manager_ops && manager_ops->mode_fixup) if (manager_ops && manager_ops->mode_fixup)
...@@ -155,8 +153,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder, ...@@ -155,8 +153,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,
struct exynos_drm_manager *manager; struct exynos_drm_manager *manager;
struct exynos_drm_manager_ops *manager_ops; struct exynos_drm_manager_ops *manager_ops;
DRM_DEBUG_KMS("%s\n", __FILE__);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) { if (connector->encoder == encoder) {
struct exynos_drm_encoder *exynos_encoder; struct exynos_drm_encoder *exynos_encoder;
...@@ -189,8 +185,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder, ...@@ -189,8 +185,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,
static void exynos_drm_encoder_prepare(struct drm_encoder *encoder) static void exynos_drm_encoder_prepare(struct drm_encoder *encoder)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* drm framework doesn't check NULL. */ /* drm framework doesn't check NULL. */
} }
...@@ -200,8 +194,6 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder) ...@@ -200,8 +194,6 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder)
struct exynos_drm_manager *manager = exynos_encoder->manager; struct exynos_drm_manager *manager = exynos_encoder->manager;
struct exynos_drm_manager_ops *manager_ops = manager->ops; struct exynos_drm_manager_ops *manager_ops = manager->ops;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (manager_ops && manager_ops->commit) if (manager_ops && manager_ops->commit)
manager_ops->commit(manager->dev); manager_ops->commit(manager->dev);
...@@ -274,8 +266,6 @@ static void exynos_drm_encoder_destroy(struct drm_encoder *encoder) ...@@ -274,8 +266,6 @@ static void exynos_drm_encoder_destroy(struct drm_encoder *encoder)
struct exynos_drm_encoder *exynos_encoder = struct exynos_drm_encoder *exynos_encoder =
to_exynos_encoder(encoder); to_exynos_encoder(encoder);
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_encoder->manager->pipe = -1; exynos_encoder->manager->pipe = -1;
drm_encoder_cleanup(encoder); drm_encoder_cleanup(encoder);
...@@ -315,8 +305,6 @@ void exynos_drm_encoder_setup(struct drm_device *dev) ...@@ -315,8 +305,6 @@ void exynos_drm_encoder_setup(struct drm_device *dev)
{ {
struct drm_encoder *encoder; struct drm_encoder *encoder;
DRM_DEBUG_KMS("%s\n", __FILE__);
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
encoder->possible_clones = exynos_drm_encoder_clones(encoder); encoder->possible_clones = exynos_drm_encoder_clones(encoder);
} }
...@@ -329,8 +317,6 @@ exynos_drm_encoder_create(struct drm_device *dev, ...@@ -329,8 +317,6 @@ exynos_drm_encoder_create(struct drm_device *dev,
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct exynos_drm_encoder *exynos_encoder; struct exynos_drm_encoder *exynos_encoder;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!manager || !possible_crtcs) if (!manager || !possible_crtcs)
return NULL; return NULL;
...@@ -427,8 +413,6 @@ void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data) ...@@ -427,8 +413,6 @@ void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data)
struct exynos_drm_manager_ops *manager_ops = manager->ops; struct exynos_drm_manager_ops *manager_ops = manager->ops;
int mode = *(int *)data; int mode = *(int *)data;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (manager_ops && manager_ops->dpms) if (manager_ops && manager_ops->dpms)
manager_ops->dpms(manager->dev, mode); manager_ops->dpms(manager->dev, mode);
...@@ -449,8 +433,6 @@ void exynos_drm_encoder_crtc_pipe(struct drm_encoder *encoder, void *data) ...@@ -449,8 +433,6 @@ void exynos_drm_encoder_crtc_pipe(struct drm_encoder *encoder, void *data)
to_exynos_encoder(encoder)->manager; to_exynos_encoder(encoder)->manager;
int pipe = *(int *)data; int pipe = *(int *)data;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* when crtc is detached from encoder, this pipe is used * when crtc is detached from encoder, this pipe is used
* to select manager operation * to select manager operation
...@@ -465,8 +447,6 @@ void exynos_drm_encoder_plane_mode_set(struct drm_encoder *encoder, void *data) ...@@ -465,8 +447,6 @@ void exynos_drm_encoder_plane_mode_set(struct drm_encoder *encoder, void *data)
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
struct exynos_drm_overlay *overlay = data; struct exynos_drm_overlay *overlay = data;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (overlay_ops && overlay_ops->mode_set) if (overlay_ops && overlay_ops->mode_set)
overlay_ops->mode_set(manager->dev, overlay); overlay_ops->mode_set(manager->dev, overlay);
} }
...@@ -478,8 +458,6 @@ void exynos_drm_encoder_plane_commit(struct drm_encoder *encoder, void *data) ...@@ -478,8 +458,6 @@ void exynos_drm_encoder_plane_commit(struct drm_encoder *encoder, void *data)
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
int zpos = DEFAULT_ZPOS; int zpos = DEFAULT_ZPOS;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (data) if (data)
zpos = *(int *)data; zpos = *(int *)data;
...@@ -494,8 +472,6 @@ void exynos_drm_encoder_plane_enable(struct drm_encoder *encoder, void *data) ...@@ -494,8 +472,6 @@ void exynos_drm_encoder_plane_enable(struct drm_encoder *encoder, void *data)
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
int zpos = DEFAULT_ZPOS; int zpos = DEFAULT_ZPOS;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (data) if (data)
zpos = *(int *)data; zpos = *(int *)data;
...@@ -510,8 +486,6 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data) ...@@ -510,8 +486,6 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data)
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
int zpos = DEFAULT_ZPOS; int zpos = DEFAULT_ZPOS;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (data) if (data)
zpos = *(int *)data; zpos = *(int *)data;
......
...@@ -70,8 +70,6 @@ static void exynos_drm_fb_destroy(struct drm_framebuffer *fb) ...@@ -70,8 +70,6 @@ static void exynos_drm_fb_destroy(struct drm_framebuffer *fb)
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
unsigned int i; unsigned int i;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* make sure that overlay data are updated before relesing fb. */ /* make sure that overlay data are updated before relesing fb. */
exynos_drm_encoder_complete_scanout(fb); exynos_drm_encoder_complete_scanout(fb);
...@@ -97,8 +95,6 @@ static int exynos_drm_fb_create_handle(struct drm_framebuffer *fb, ...@@ -97,8 +95,6 @@ static int exynos_drm_fb_create_handle(struct drm_framebuffer *fb,
{ {
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
DRM_DEBUG_KMS("%s\n", __FILE__);
/* This fb should have only one gem object. */ /* This fb should have only one gem object. */
if (WARN_ON(exynos_fb->buf_cnt != 1)) if (WARN_ON(exynos_fb->buf_cnt != 1))
return -EINVAL; return -EINVAL;
...@@ -112,8 +108,6 @@ static int exynos_drm_fb_dirty(struct drm_framebuffer *fb, ...@@ -112,8 +108,6 @@ static int exynos_drm_fb_dirty(struct drm_framebuffer *fb,
unsigned color, struct drm_clip_rect *clips, unsigned color, struct drm_clip_rect *clips,
unsigned num_clips) unsigned num_clips)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO */ /* TODO */
return 0; return 0;
...@@ -225,8 +219,6 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, ...@@ -225,8 +219,6 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
struct exynos_drm_fb *exynos_fb; struct exynos_drm_fb *exynos_fb;
int i, ret; int i, ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL); exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL);
if (!exynos_fb) { if (!exynos_fb) {
DRM_ERROR("failed to allocate exynos drm framebuffer\n"); DRM_ERROR("failed to allocate exynos drm framebuffer\n");
...@@ -293,8 +285,6 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb, ...@@ -293,8 +285,6 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb,
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
struct exynos_drm_gem_buf *buffer; struct exynos_drm_gem_buf *buffer;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (index >= MAX_FB_BUFFER) if (index >= MAX_FB_BUFFER)
return NULL; return NULL;
......
...@@ -43,8 +43,6 @@ static int exynos_drm_fb_mmap(struct fb_info *info, ...@@ -43,8 +43,6 @@ static int exynos_drm_fb_mmap(struct fb_info *info,
unsigned long vm_size; unsigned long vm_size;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __func__);
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
vm_size = vma->vm_end - vma->vm_start; vm_size = vma->vm_end - vma->vm_start;
...@@ -84,8 +82,6 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, ...@@ -84,8 +82,6 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
unsigned int size = fb->width * fb->height * (fb->bits_per_pixel >> 3); unsigned int size = fb->width * fb->height * (fb->bits_per_pixel >> 3);
unsigned long offset; unsigned long offset;
DRM_DEBUG_KMS("%s\n", __FILE__);
drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth); drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height); drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height);
...@@ -148,8 +144,6 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, ...@@ -148,8 +144,6 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
unsigned long size; unsigned long size;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d\n", DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d\n",
sizes->surface_width, sizes->surface_height, sizes->surface_width, sizes->surface_height,
sizes->surface_bpp); sizes->surface_bpp);
...@@ -238,8 +232,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev) ...@@ -238,8 +232,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
unsigned int num_crtc; unsigned int num_crtc;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector) if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector)
return 0; return 0;
......
...@@ -175,8 +175,6 @@ static void fimc_sw_reset(struct fimc_context *ctx) ...@@ -175,8 +175,6 @@ static void fimc_sw_reset(struct fimc_context *ctx)
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s\n", __func__);
/* stop dma operation */ /* stop dma operation */
cfg = fimc_read(EXYNOS_CISTATUS); cfg = fimc_read(EXYNOS_CISTATUS);
if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) { if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) {
...@@ -210,8 +208,6 @@ static void fimc_sw_reset(struct fimc_context *ctx) ...@@ -210,8 +208,6 @@ static void fimc_sw_reset(struct fimc_context *ctx)
static int fimc_set_camblk_fimd0_wb(struct fimc_context *ctx) static int fimc_set_camblk_fimd0_wb(struct fimc_context *ctx)
{ {
DRM_DEBUG_KMS("%s\n", __func__);
return regmap_update_bits(ctx->sysreg, SYSREG_CAMERA_BLK, return regmap_update_bits(ctx->sysreg, SYSREG_CAMERA_BLK,
SYSREG_FIMD0WB_DEST_MASK, SYSREG_FIMD0WB_DEST_MASK,
ctx->id << SYSREG_FIMD0WB_DEST_SHIFT); ctx->id << SYSREG_FIMD0WB_DEST_SHIFT);
...@@ -221,7 +217,7 @@ static void fimc_set_type_ctrl(struct fimc_context *ctx, enum fimc_wb wb) ...@@ -221,7 +217,7 @@ static void fimc_set_type_ctrl(struct fimc_context *ctx, enum fimc_wb wb)
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:wb[%d]\n", __func__, wb); DRM_DEBUG_KMS("wb[%d]\n", wb);
cfg = fimc_read(EXYNOS_CIGCTRL); cfg = fimc_read(EXYNOS_CIGCTRL);
cfg &= ~(EXYNOS_CIGCTRL_TESTPATTERN_MASK | cfg &= ~(EXYNOS_CIGCTRL_TESTPATTERN_MASK |
...@@ -257,10 +253,10 @@ static void fimc_set_polarity(struct fimc_context *ctx, ...@@ -257,10 +253,10 @@ static void fimc_set_polarity(struct fimc_context *ctx,
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:inv_pclk[%d]inv_vsync[%d]\n", DRM_DEBUG_KMS("inv_pclk[%d]inv_vsync[%d]\n",
__func__, pol->inv_pclk, pol->inv_vsync); pol->inv_pclk, pol->inv_vsync);
DRM_DEBUG_KMS("%s:inv_href[%d]inv_hsync[%d]\n", DRM_DEBUG_KMS("inv_href[%d]inv_hsync[%d]\n",
__func__, pol->inv_href, pol->inv_hsync); pol->inv_href, pol->inv_hsync);
cfg = fimc_read(EXYNOS_CIGCTRL); cfg = fimc_read(EXYNOS_CIGCTRL);
cfg &= ~(EXYNOS_CIGCTRL_INVPOLPCLK | EXYNOS_CIGCTRL_INVPOLVSYNC | cfg &= ~(EXYNOS_CIGCTRL_INVPOLPCLK | EXYNOS_CIGCTRL_INVPOLVSYNC |
...@@ -282,7 +278,7 @@ static void fimc_handle_jpeg(struct fimc_context *ctx, bool enable) ...@@ -282,7 +278,7 @@ static void fimc_handle_jpeg(struct fimc_context *ctx, bool enable)
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable); DRM_DEBUG_KMS("enable[%d]\n", enable);
cfg = fimc_read(EXYNOS_CIGCTRL); cfg = fimc_read(EXYNOS_CIGCTRL);
if (enable) if (enable)
...@@ -298,7 +294,7 @@ static void fimc_handle_irq(struct fimc_context *ctx, bool enable, ...@@ -298,7 +294,7 @@ static void fimc_handle_irq(struct fimc_context *ctx, bool enable,
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:enable[%d]overflow[%d]level[%d]\n", __func__, DRM_DEBUG_KMS("enable[%d]overflow[%d]level[%d]\n",
enable, overflow, level); enable, overflow, level);
cfg = fimc_read(EXYNOS_CIGCTRL); cfg = fimc_read(EXYNOS_CIGCTRL);
...@@ -319,8 +315,6 @@ static void fimc_clear_irq(struct fimc_context *ctx) ...@@ -319,8 +315,6 @@ static void fimc_clear_irq(struct fimc_context *ctx)
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s\n", __func__);
cfg = fimc_read(EXYNOS_CIGCTRL); cfg = fimc_read(EXYNOS_CIGCTRL);
cfg |= EXYNOS_CIGCTRL_IRQ_CLR; cfg |= EXYNOS_CIGCTRL_IRQ_CLR;
fimc_write(cfg, EXYNOS_CIGCTRL); fimc_write(cfg, EXYNOS_CIGCTRL);
...@@ -335,7 +329,7 @@ static bool fimc_check_ovf(struct fimc_context *ctx) ...@@ -335,7 +329,7 @@ static bool fimc_check_ovf(struct fimc_context *ctx)
flag = EXYNOS_CISTATUS_OVFIY | EXYNOS_CISTATUS_OVFICB | flag = EXYNOS_CISTATUS_OVFIY | EXYNOS_CISTATUS_OVFICB |
EXYNOS_CISTATUS_OVFICR; EXYNOS_CISTATUS_OVFICR;
DRM_DEBUG_KMS("%s:flag[0x%x]\n", __func__, flag); DRM_DEBUG_KMS("flag[0x%x]\n", flag);
if (status & flag) { if (status & flag) {
cfg = fimc_read(EXYNOS_CIWDOFST); cfg = fimc_read(EXYNOS_CIWDOFST);
...@@ -364,7 +358,7 @@ static bool fimc_check_frame_end(struct fimc_context *ctx) ...@@ -364,7 +358,7 @@ static bool fimc_check_frame_end(struct fimc_context *ctx)
cfg = fimc_read(EXYNOS_CISTATUS); cfg = fimc_read(EXYNOS_CISTATUS);
DRM_DEBUG_KMS("%s:cfg[0x%x]\n", __func__, cfg); DRM_DEBUG_KMS("cfg[0x%x]\n", cfg);
if (!(cfg & EXYNOS_CISTATUS_FRAMEEND)) if (!(cfg & EXYNOS_CISTATUS_FRAMEEND))
return false; return false;
...@@ -380,15 +374,13 @@ static int fimc_get_buf_id(struct fimc_context *ctx) ...@@ -380,15 +374,13 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
u32 cfg; u32 cfg;
int frame_cnt, buf_id; int frame_cnt, buf_id;
DRM_DEBUG_KMS("%s\n", __func__);
cfg = fimc_read(EXYNOS_CISTATUS2); cfg = fimc_read(EXYNOS_CISTATUS2);
frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg); frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg);
if (frame_cnt == 0) if (frame_cnt == 0)
frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg); frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg);
DRM_DEBUG_KMS("%s:present[%d]before[%d]\n", __func__, DRM_DEBUG_KMS("present[%d]before[%d]\n",
EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg), EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg),
EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg)); EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg));
...@@ -398,7 +390,7 @@ static int fimc_get_buf_id(struct fimc_context *ctx) ...@@ -398,7 +390,7 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
} }
buf_id = frame_cnt - 1; buf_id = frame_cnt - 1;
DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id); DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);
return buf_id; return buf_id;
} }
...@@ -407,7 +399,7 @@ static void fimc_handle_lastend(struct fimc_context *ctx, bool enable) ...@@ -407,7 +399,7 @@ static void fimc_handle_lastend(struct fimc_context *ctx, bool enable)
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable); DRM_DEBUG_KMS("enable[%d]\n", enable);
cfg = fimc_read(EXYNOS_CIOCTRL); cfg = fimc_read(EXYNOS_CIOCTRL);
if (enable) if (enable)
...@@ -424,7 +416,7 @@ static int fimc_src_set_fmt_order(struct fimc_context *ctx, u32 fmt) ...@@ -424,7 +416,7 @@ static int fimc_src_set_fmt_order(struct fimc_context *ctx, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt); DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
/* RGB */ /* RGB */
cfg = fimc_read(EXYNOS_CISCCTRL); cfg = fimc_read(EXYNOS_CISCCTRL);
...@@ -497,7 +489,7 @@ static int fimc_src_set_fmt(struct device *dev, u32 fmt) ...@@ -497,7 +489,7 @@ static int fimc_src_set_fmt(struct device *dev, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt); DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
cfg = fimc_read(EXYNOS_MSCTRL); cfg = fimc_read(EXYNOS_MSCTRL);
cfg &= ~EXYNOS_MSCTRL_INFORMAT_RGB; cfg &= ~EXYNOS_MSCTRL_INFORMAT_RGB;
...@@ -557,8 +549,7 @@ static int fimc_src_set_transf(struct device *dev, ...@@ -557,8 +549,7 @@ static int fimc_src_set_transf(struct device *dev,
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg1, cfg2; u32 cfg1, cfg2;
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__, DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
degree, flip);
cfg1 = fimc_read(EXYNOS_MSCTRL); cfg1 = fimc_read(EXYNOS_MSCTRL);
cfg1 &= ~(EXYNOS_MSCTRL_FLIP_X_MIRROR | cfg1 &= ~(EXYNOS_MSCTRL_FLIP_X_MIRROR |
...@@ -621,10 +612,9 @@ static int fimc_set_window(struct fimc_context *ctx, ...@@ -621,10 +612,9 @@ static int fimc_set_window(struct fimc_context *ctx,
v1 = pos->y; v1 = pos->y;
v2 = sz->vsize - pos->h - pos->y; v2 = sz->vsize - pos->h - pos->y;
DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n", DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
__func__, pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize); pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize);
DRM_DEBUG_KMS("%s:h1[%d]h2[%d]v1[%d]v2[%d]\n", __func__, DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2);
h1, h2, v1, v2);
/* /*
* set window offset 1, 2 size * set window offset 1, 2 size
...@@ -653,8 +643,8 @@ static int fimc_src_set_size(struct device *dev, int swap, ...@@ -653,8 +643,8 @@ static int fimc_src_set_size(struct device *dev, int swap,
struct drm_exynos_sz img_sz = *sz; struct drm_exynos_sz img_sz = *sz;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n", DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
__func__, swap, sz->hsize, sz->vsize); swap, sz->hsize, sz->vsize);
/* original size */ /* original size */
cfg = (EXYNOS_ORGISIZE_HORIZONTAL(img_sz.hsize) | cfg = (EXYNOS_ORGISIZE_HORIZONTAL(img_sz.hsize) |
...@@ -662,8 +652,7 @@ static int fimc_src_set_size(struct device *dev, int swap, ...@@ -662,8 +652,7 @@ static int fimc_src_set_size(struct device *dev, int swap,
fimc_write(cfg, EXYNOS_ORGISIZE); fimc_write(cfg, EXYNOS_ORGISIZE);
DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n", __func__, DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);
pos->x, pos->y, pos->w, pos->h);
if (swap) { if (swap) {
img_pos.w = pos->h; img_pos.w = pos->h;
...@@ -720,7 +709,7 @@ static int fimc_src_set_addr(struct device *dev, ...@@ -720,7 +709,7 @@ static int fimc_src_set_addr(struct device *dev,
property = &c_node->property; property = &c_node->property;
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type); property->prop_id, buf_id, buf_type);
if (buf_id > FIMC_MAX_SRC) { if (buf_id > FIMC_MAX_SRC) {
...@@ -772,7 +761,7 @@ static int fimc_dst_set_fmt_order(struct fimc_context *ctx, u32 fmt) ...@@ -772,7 +761,7 @@ static int fimc_dst_set_fmt_order(struct fimc_context *ctx, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt); DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
/* RGB */ /* RGB */
cfg = fimc_read(EXYNOS_CISCCTRL); cfg = fimc_read(EXYNOS_CISCCTRL);
...@@ -851,7 +840,7 @@ static int fimc_dst_set_fmt(struct device *dev, u32 fmt) ...@@ -851,7 +840,7 @@ static int fimc_dst_set_fmt(struct device *dev, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt); DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
cfg = fimc_read(EXYNOS_CIEXTEN); cfg = fimc_read(EXYNOS_CIEXTEN);
...@@ -919,8 +908,7 @@ static int fimc_dst_set_transf(struct device *dev, ...@@ -919,8 +908,7 @@ static int fimc_dst_set_transf(struct device *dev,
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__, DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
degree, flip);
cfg = fimc_read(EXYNOS_CITRGFMT); cfg = fimc_read(EXYNOS_CITRGFMT);
cfg &= ~EXYNOS_CITRGFMT_FLIP_MASK; cfg &= ~EXYNOS_CITRGFMT_FLIP_MASK;
...@@ -970,7 +958,7 @@ static int fimc_dst_set_transf(struct device *dev, ...@@ -970,7 +958,7 @@ static int fimc_dst_set_transf(struct device *dev,
static int fimc_get_ratio_shift(u32 src, u32 dst, u32 *ratio, u32 *shift) static int fimc_get_ratio_shift(u32 src, u32 dst, u32 *ratio, u32 *shift)
{ {
DRM_DEBUG_KMS("%s:src[%d]dst[%d]\n", __func__, src, dst); DRM_DEBUG_KMS("src[%d]dst[%d]\n", src, dst);
if (src >= dst * 64) { if (src >= dst * 64) {
DRM_ERROR("failed to make ratio and shift.\n"); DRM_ERROR("failed to make ratio and shift.\n");
...@@ -1039,20 +1027,20 @@ static int fimc_set_prescaler(struct fimc_context *ctx, struct fimc_scaler *sc, ...@@ -1039,20 +1027,20 @@ static int fimc_set_prescaler(struct fimc_context *ctx, struct fimc_scaler *sc,
pre_dst_width = src_w / pre_hratio; pre_dst_width = src_w / pre_hratio;
pre_dst_height = src_h / pre_vratio; pre_dst_height = src_h / pre_vratio;
DRM_DEBUG_KMS("%s:pre_dst_width[%d]pre_dst_height[%d]\n", __func__, DRM_DEBUG_KMS("pre_dst_width[%d]pre_dst_height[%d]\n",
pre_dst_width, pre_dst_height); pre_dst_width, pre_dst_height);
DRM_DEBUG_KMS("%s:pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n", DRM_DEBUG_KMS("pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n",
__func__, pre_hratio, hfactor, pre_vratio, vfactor); pre_hratio, hfactor, pre_vratio, vfactor);
sc->hratio = (src_w << 14) / (dst_w << hfactor); sc->hratio = (src_w << 14) / (dst_w << hfactor);
sc->vratio = (src_h << 14) / (dst_h << vfactor); sc->vratio = (src_h << 14) / (dst_h << vfactor);
sc->up_h = (dst_w >= src_w) ? true : false; sc->up_h = (dst_w >= src_w) ? true : false;
sc->up_v = (dst_h >= src_h) ? true : false; sc->up_v = (dst_h >= src_h) ? true : false;
DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n", DRM_DEBUG_KMS("hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
__func__, sc->hratio, sc->vratio, sc->up_h, sc->up_v); sc->hratio, sc->vratio, sc->up_h, sc->up_v);
shfactor = FIMC_SHFACTOR - (hfactor + vfactor); shfactor = FIMC_SHFACTOR - (hfactor + vfactor);
DRM_DEBUG_KMS("%s:shfactor[%d]\n", __func__, shfactor); DRM_DEBUG_KMS("shfactor[%d]\n", shfactor);
cfg = (EXYNOS_CISCPRERATIO_SHFACTOR(shfactor) | cfg = (EXYNOS_CISCPRERATIO_SHFACTOR(shfactor) |
EXYNOS_CISCPRERATIO_PREHORRATIO(pre_hratio) | EXYNOS_CISCPRERATIO_PREHORRATIO(pre_hratio) |
...@@ -1070,10 +1058,10 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc) ...@@ -1070,10 +1058,10 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc)
{ {
u32 cfg, cfg_ext; u32 cfg, cfg_ext;
DRM_DEBUG_KMS("%s:range[%d]bypass[%d]up_h[%d]up_v[%d]\n", DRM_DEBUG_KMS("range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
__func__, sc->range, sc->bypass, sc->up_h, sc->up_v); sc->range, sc->bypass, sc->up_h, sc->up_v);
DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]\n", DRM_DEBUG_KMS("hratio[%d]vratio[%d]\n",
__func__, sc->hratio, sc->vratio); sc->hratio, sc->vratio);
cfg = fimc_read(EXYNOS_CISCCTRL); cfg = fimc_read(EXYNOS_CISCCTRL);
cfg &= ~(EXYNOS_CISCCTRL_SCALERBYPASS | cfg &= ~(EXYNOS_CISCCTRL_SCALERBYPASS |
...@@ -1113,8 +1101,8 @@ static int fimc_dst_set_size(struct device *dev, int swap, ...@@ -1113,8 +1101,8 @@ static int fimc_dst_set_size(struct device *dev, int swap,
struct drm_exynos_sz img_sz = *sz; struct drm_exynos_sz img_sz = *sz;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n", DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
__func__, swap, sz->hsize, sz->vsize); swap, sz->hsize, sz->vsize);
/* original size */ /* original size */
cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(img_sz.hsize) | cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(img_sz.hsize) |
...@@ -1122,8 +1110,7 @@ static int fimc_dst_set_size(struct device *dev, int swap, ...@@ -1122,8 +1110,7 @@ static int fimc_dst_set_size(struct device *dev, int swap,
fimc_write(cfg, EXYNOS_ORGOSIZE); fimc_write(cfg, EXYNOS_ORGOSIZE);
DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n", DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);
__func__, pos->x, pos->y, pos->w, pos->h);
/* CSC ITU */ /* CSC ITU */
cfg = fimc_read(EXYNOS_CIGCTRL); cfg = fimc_read(EXYNOS_CIGCTRL);
...@@ -1180,7 +1167,7 @@ static int fimc_dst_get_buf_seq(struct fimc_context *ctx) ...@@ -1180,7 +1167,7 @@ static int fimc_dst_get_buf_seq(struct fimc_context *ctx)
if (cfg & (mask << i)) if (cfg & (mask << i))
buf_num++; buf_num++;
DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num); DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);
return buf_num; return buf_num;
} }
...@@ -1194,8 +1181,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, ...@@ -1194,8 +1181,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
u32 mask = 0x00000001 << buf_id; u32 mask = 0x00000001 << buf_id;
int ret = 0; int ret = 0;
DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__, DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);
buf_id, buf_type);
mutex_lock(&ctx->lock); mutex_lock(&ctx->lock);
...@@ -1252,7 +1238,7 @@ static int fimc_dst_set_addr(struct device *dev, ...@@ -1252,7 +1238,7 @@ static int fimc_dst_set_addr(struct device *dev,
property = &c_node->property; property = &c_node->property;
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type); property->prop_id, buf_id, buf_type);
if (buf_id > FIMC_MAX_DST) { if (buf_id > FIMC_MAX_DST) {
...@@ -1302,7 +1288,7 @@ static struct exynos_drm_ipp_ops fimc_dst_ops = { ...@@ -1302,7 +1288,7 @@ static struct exynos_drm_ipp_ops fimc_dst_ops = {
static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable) static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
{ {
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable); DRM_DEBUG_KMS("enable[%d]\n", enable);
if (enable) { if (enable) {
clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]); clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
...@@ -1326,7 +1312,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) ...@@ -1326,7 +1312,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
c_node->event_work; c_node->event_work;
int buf_id; int buf_id;
DRM_DEBUG_KMS("%s:fimc id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("fimc id[%d]\n", ctx->id);
fimc_clear_irq(ctx); fimc_clear_irq(ctx);
if (fimc_check_ovf(ctx)) if (fimc_check_ovf(ctx))
...@@ -1339,7 +1325,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) ...@@ -1339,7 +1325,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
if (buf_id < 0) if (buf_id < 0)
return IRQ_HANDLED; return IRQ_HANDLED;
DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id); DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);
if (fimc_dst_set_buf_seq(ctx, buf_id, IPP_BUF_DEQUEUE) < 0) { if (fimc_dst_set_buf_seq(ctx, buf_id, IPP_BUF_DEQUEUE) < 0) {
DRM_ERROR("failed to dequeue.\n"); DRM_ERROR("failed to dequeue.\n");
...@@ -1357,8 +1343,6 @@ static int fimc_init_prop_list(struct exynos_drm_ippdrv *ippdrv) ...@@ -1357,8 +1343,6 @@ static int fimc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
{ {
struct drm_exynos_ipp_prop_list *prop_list; struct drm_exynos_ipp_prop_list *prop_list;
DRM_DEBUG_KMS("%s\n", __func__);
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL); prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
if (!prop_list) { if (!prop_list) {
DRM_ERROR("failed to alloc property list.\n"); DRM_ERROR("failed to alloc property list.\n");
...@@ -1402,7 +1386,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) ...@@ -1402,7 +1386,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip)
case EXYNOS_DRM_FLIP_BOTH: case EXYNOS_DRM_FLIP_BOTH:
return true; return true;
default: default:
DRM_DEBUG_KMS("%s:invalid flip\n", __func__); DRM_DEBUG_KMS("invalid flip\n");
return false; return false;
} }
} }
...@@ -1419,8 +1403,6 @@ static int fimc_ippdrv_check_property(struct device *dev, ...@@ -1419,8 +1403,6 @@ static int fimc_ippdrv_check_property(struct device *dev,
bool swap; bool swap;
int i; int i;
DRM_DEBUG_KMS("%s\n", __func__);
for_each_ipp_ops(i) { for_each_ipp_ops(i) {
if ((i == EXYNOS_DRM_OPS_SRC) && if ((i == EXYNOS_DRM_OPS_SRC) &&
(property->cmd == IPP_CMD_WB)) (property->cmd == IPP_CMD_WB))
...@@ -1526,8 +1508,6 @@ static void fimc_clear_addr(struct fimc_context *ctx) ...@@ -1526,8 +1508,6 @@ static void fimc_clear_addr(struct fimc_context *ctx)
{ {
int i; int i;
DRM_DEBUG_KMS("%s:\n", __func__);
for (i = 0; i < FIMC_MAX_SRC; i++) { for (i = 0; i < FIMC_MAX_SRC; i++) {
fimc_write(0, EXYNOS_CIIYSA(i)); fimc_write(0, EXYNOS_CIIYSA(i));
fimc_write(0, EXYNOS_CIICBSA(i)); fimc_write(0, EXYNOS_CIICBSA(i));
...@@ -1545,8 +1525,6 @@ static int fimc_ippdrv_reset(struct device *dev) ...@@ -1545,8 +1525,6 @@ static int fimc_ippdrv_reset(struct device *dev)
{ {
struct fimc_context *ctx = get_fimc_context(dev); struct fimc_context *ctx = get_fimc_context(dev);
DRM_DEBUG_KMS("%s\n", __func__);
/* reset h/w block */ /* reset h/w block */
fimc_sw_reset(ctx); fimc_sw_reset(ctx);
...@@ -1570,7 +1548,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) ...@@ -1570,7 +1548,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
int ret, i; int ret, i;
u32 cfg0, cfg1; u32 cfg0, cfg1;
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd); DRM_DEBUG_KMS("cmd[%d]\n", cmd);
if (!c_node) { if (!c_node) {
DRM_ERROR("failed to get c_node.\n"); DRM_ERROR("failed to get c_node.\n");
...@@ -1679,7 +1657,7 @@ static void fimc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd) ...@@ -1679,7 +1657,7 @@ static void fimc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
struct drm_exynos_ipp_set_wb set_wb = {0, 0}; struct drm_exynos_ipp_set_wb set_wb = {0, 0};
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd); DRM_DEBUG_KMS("cmd[%d]\n", cmd);
switch (cmd) { switch (cmd) {
case IPP_CMD_M2M: case IPP_CMD_M2M:
...@@ -1869,8 +1847,7 @@ static int fimc_probe(struct platform_device *pdev) ...@@ -1869,8 +1847,7 @@ static int fimc_probe(struct platform_device *pdev)
goto err_put_clk; goto err_put_clk;
} }
DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id, DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv);
(int)ippdrv);
mutex_init(&ctx->lock); mutex_init(&ctx->lock);
platform_set_drvdata(pdev, ctx); platform_set_drvdata(pdev, ctx);
...@@ -1917,7 +1894,7 @@ static int fimc_suspend(struct device *dev) ...@@ -1917,7 +1894,7 @@ static int fimc_suspend(struct device *dev)
{ {
struct fimc_context *ctx = get_fimc_context(dev); struct fimc_context *ctx = get_fimc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
if (pm_runtime_suspended(dev)) if (pm_runtime_suspended(dev))
return 0; return 0;
...@@ -1929,7 +1906,7 @@ static int fimc_resume(struct device *dev) ...@@ -1929,7 +1906,7 @@ static int fimc_resume(struct device *dev)
{ {
struct fimc_context *ctx = get_fimc_context(dev); struct fimc_context *ctx = get_fimc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
if (!pm_runtime_suspended(dev)) if (!pm_runtime_suspended(dev))
return fimc_clk_ctrl(ctx, true); return fimc_clk_ctrl(ctx, true);
...@@ -1943,7 +1920,7 @@ static int fimc_runtime_suspend(struct device *dev) ...@@ -1943,7 +1920,7 @@ static int fimc_runtime_suspend(struct device *dev)
{ {
struct fimc_context *ctx = get_fimc_context(dev); struct fimc_context *ctx = get_fimc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
return fimc_clk_ctrl(ctx, false); return fimc_clk_ctrl(ctx, false);
} }
...@@ -1952,7 +1929,7 @@ static int fimc_runtime_resume(struct device *dev) ...@@ -1952,7 +1929,7 @@ static int fimc_runtime_resume(struct device *dev)
{ {
struct fimc_context *ctx = get_fimc_context(dev); struct fimc_context *ctx = get_fimc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
return fimc_clk_ctrl(ctx, true); return fimc_clk_ctrl(ctx, true);
} }
......
...@@ -63,14 +63,24 @@ ...@@ -63,14 +63,24 @@
struct fimd_driver_data { struct fimd_driver_data {
unsigned int timing_base; unsigned int timing_base;
unsigned int has_shadowcon:1;
unsigned int has_clksel:1;
};
static struct fimd_driver_data s3c64xx_fimd_driver_data = {
.timing_base = 0x0,
.has_clksel = 1,
}; };
static struct fimd_driver_data exynos4_fimd_driver_data = { static struct fimd_driver_data exynos4_fimd_driver_data = {
.timing_base = 0x0, .timing_base = 0x0,
.has_shadowcon = 1,
}; };
static struct fimd_driver_data exynos5_fimd_driver_data = { static struct fimd_driver_data exynos5_fimd_driver_data = {
.timing_base = 0x20000, .timing_base = 0x20000,
.has_shadowcon = 1,
}; };
struct fimd_win_data { struct fimd_win_data {
...@@ -107,10 +117,13 @@ struct fimd_context { ...@@ -107,10 +117,13 @@ struct fimd_context {
atomic_t wait_vsync_event; atomic_t wait_vsync_event;
struct exynos_drm_panel_info *panel; struct exynos_drm_panel_info *panel;
struct fimd_driver_data *driver_data;
}; };
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id fimd_driver_dt_match[] = { static const struct of_device_id fimd_driver_dt_match[] = {
{ .compatible = "samsung,s3c6400-fimd",
.data = &s3c64xx_fimd_driver_data },
{ .compatible = "samsung,exynos4210-fimd", { .compatible = "samsung,exynos4210-fimd",
.data = &exynos4_fimd_driver_data }, .data = &exynos4_fimd_driver_data },
{ .compatible = "samsung,exynos5250-fimd", { .compatible = "samsung,exynos5250-fimd",
...@@ -137,8 +150,6 @@ static inline struct fimd_driver_data *drm_fimd_get_driver_data( ...@@ -137,8 +150,6 @@ static inline struct fimd_driver_data *drm_fimd_get_driver_data(
static bool fimd_display_is_connected(struct device *dev) static bool fimd_display_is_connected(struct device *dev)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO. */ /* TODO. */
return true; return true;
...@@ -148,15 +159,11 @@ static void *fimd_get_panel(struct device *dev) ...@@ -148,15 +159,11 @@ static void *fimd_get_panel(struct device *dev)
{ {
struct fimd_context *ctx = get_fimd_context(dev); struct fimd_context *ctx = get_fimd_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
return ctx->panel; return ctx->panel;
} }
static int fimd_check_timing(struct device *dev, void *timing) static int fimd_check_mode(struct device *dev, struct drm_display_mode *mode)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO. */ /* TODO. */
return 0; return 0;
...@@ -164,8 +171,6 @@ static int fimd_check_timing(struct device *dev, void *timing) ...@@ -164,8 +171,6 @@ static int fimd_check_timing(struct device *dev, void *timing)
static int fimd_display_power_on(struct device *dev, int mode) static int fimd_display_power_on(struct device *dev, int mode)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO */ /* TODO */
return 0; return 0;
...@@ -175,7 +180,7 @@ static struct exynos_drm_display_ops fimd_display_ops = { ...@@ -175,7 +180,7 @@ static struct exynos_drm_display_ops fimd_display_ops = {
.type = EXYNOS_DISPLAY_TYPE_LCD, .type = EXYNOS_DISPLAY_TYPE_LCD,
.is_connected = fimd_display_is_connected, .is_connected = fimd_display_is_connected,
.get_panel = fimd_get_panel, .get_panel = fimd_get_panel,
.check_timing = fimd_check_timing, .check_mode = fimd_check_mode,
.power_on = fimd_display_power_on, .power_on = fimd_display_power_on,
}; };
...@@ -183,7 +188,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode) ...@@ -183,7 +188,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode)
{ {
struct fimd_context *ctx = get_fimd_context(subdrv_dev); struct fimd_context *ctx = get_fimd_context(subdrv_dev);
DRM_DEBUG_KMS("%s, %d\n", __FILE__, mode); DRM_DEBUG_KMS("%d\n", mode);
mutex_lock(&ctx->lock); mutex_lock(&ctx->lock);
...@@ -221,8 +226,6 @@ static void fimd_apply(struct device *subdrv_dev) ...@@ -221,8 +226,6 @@ static void fimd_apply(struct device *subdrv_dev)
struct fimd_win_data *win_data; struct fimd_win_data *win_data;
int i; int i;
DRM_DEBUG_KMS("%s\n", __FILE__);
for (i = 0; i < WINDOWS_NR; i++) { for (i = 0; i < WINDOWS_NR; i++) {
win_data = &ctx->win_data[i]; win_data = &ctx->win_data[i];
if (win_data->enabled && (ovl_ops && ovl_ops->commit)) if (win_data->enabled && (ovl_ops && ovl_ops->commit))
...@@ -239,15 +242,12 @@ static void fimd_commit(struct device *dev) ...@@ -239,15 +242,12 @@ static void fimd_commit(struct device *dev)
struct exynos_drm_panel_info *panel = ctx->panel; struct exynos_drm_panel_info *panel = ctx->panel;
struct fb_videomode *timing = &panel->timing; struct fb_videomode *timing = &panel->timing;
struct fimd_driver_data *driver_data; struct fimd_driver_data *driver_data;
struct platform_device *pdev = to_platform_device(dev);
u32 val; u32 val;
driver_data = drm_fimd_get_driver_data(pdev); driver_data = ctx->driver_data;
if (ctx->suspended) if (ctx->suspended)
return; return;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* setup polarity values from machine code. */ /* setup polarity values from machine code. */
writel(ctx->vidcon1, ctx->regs + driver_data->timing_base + VIDCON1); writel(ctx->vidcon1, ctx->regs + driver_data->timing_base + VIDCON1);
...@@ -274,6 +274,11 @@ static void fimd_commit(struct device *dev) ...@@ -274,6 +274,11 @@ static void fimd_commit(struct device *dev)
val = ctx->vidcon0; val = ctx->vidcon0;
val &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR); val &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
if (ctx->driver_data->has_clksel) {
val &= ~VIDCON0_CLKSEL_MASK;
val |= VIDCON0_CLKSEL_LCD;
}
if (ctx->clkdiv > 1) if (ctx->clkdiv > 1)
val |= VIDCON0_CLKVAL_F(ctx->clkdiv - 1) | VIDCON0_CLKDIR; val |= VIDCON0_CLKVAL_F(ctx->clkdiv - 1) | VIDCON0_CLKDIR;
else else
...@@ -292,8 +297,6 @@ static int fimd_enable_vblank(struct device *dev) ...@@ -292,8 +297,6 @@ static int fimd_enable_vblank(struct device *dev)
struct fimd_context *ctx = get_fimd_context(dev); struct fimd_context *ctx = get_fimd_context(dev);
u32 val; u32 val;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ctx->suspended) if (ctx->suspended)
return -EPERM; return -EPERM;
...@@ -319,8 +322,6 @@ static void fimd_disable_vblank(struct device *dev) ...@@ -319,8 +322,6 @@ static void fimd_disable_vblank(struct device *dev)
struct fimd_context *ctx = get_fimd_context(dev); struct fimd_context *ctx = get_fimd_context(dev);
u32 val; u32 val;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ctx->suspended) if (ctx->suspended)
return; return;
...@@ -370,8 +371,6 @@ static void fimd_win_mode_set(struct device *dev, ...@@ -370,8 +371,6 @@ static void fimd_win_mode_set(struct device *dev,
int win; int win;
unsigned long offset; unsigned long offset;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!overlay) { if (!overlay) {
dev_err(dev, "overlay is NULL\n"); dev_err(dev, "overlay is NULL\n");
return; return;
...@@ -381,7 +380,7 @@ static void fimd_win_mode_set(struct device *dev, ...@@ -381,7 +380,7 @@ static void fimd_win_mode_set(struct device *dev,
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = ctx->default_win; win = ctx->default_win;
if (win < 0 || win > WINDOWS_NR) if (win < 0 || win >= WINDOWS_NR)
return; return;
offset = overlay->fb_x * (overlay->bpp >> 3); offset = overlay->fb_x * (overlay->bpp >> 3);
...@@ -418,8 +417,6 @@ static void fimd_win_set_pixfmt(struct device *dev, unsigned int win) ...@@ -418,8 +417,6 @@ static void fimd_win_set_pixfmt(struct device *dev, unsigned int win)
struct fimd_win_data *win_data = &ctx->win_data[win]; struct fimd_win_data *win_data = &ctx->win_data[win];
unsigned long val; unsigned long val;
DRM_DEBUG_KMS("%s\n", __FILE__);
val = WINCONx_ENWIN; val = WINCONx_ENWIN;
switch (win_data->bpp) { switch (win_data->bpp) {
...@@ -478,8 +475,6 @@ static void fimd_win_set_colkey(struct device *dev, unsigned int win) ...@@ -478,8 +475,6 @@ static void fimd_win_set_colkey(struct device *dev, unsigned int win)
struct fimd_context *ctx = get_fimd_context(dev); struct fimd_context *ctx = get_fimd_context(dev);
unsigned int keycon0 = 0, keycon1 = 0; unsigned int keycon0 = 0, keycon1 = 0;
DRM_DEBUG_KMS("%s\n", __FILE__);
keycon0 = ~(WxKEYCON0_KEYBL_EN | WxKEYCON0_KEYEN_F | keycon0 = ~(WxKEYCON0_KEYBL_EN | WxKEYCON0_KEYEN_F |
WxKEYCON0_DIRCON) | WxKEYCON0_COMPKEY(0); WxKEYCON0_DIRCON) | WxKEYCON0_COMPKEY(0);
...@@ -489,6 +484,33 @@ static void fimd_win_set_colkey(struct device *dev, unsigned int win) ...@@ -489,6 +484,33 @@ static void fimd_win_set_colkey(struct device *dev, unsigned int win)
writel(keycon1, ctx->regs + WKEYCON1_BASE(win)); writel(keycon1, ctx->regs + WKEYCON1_BASE(win));
} }
/**
* shadow_protect_win() - disable updating values from shadow registers at vsync
*
* @win: window to protect registers for
* @protect: 1 to protect (disable updates)
*/
static void fimd_shadow_protect_win(struct fimd_context *ctx,
int win, bool protect)
{
u32 reg, bits, val;
if (ctx->driver_data->has_shadowcon) {
reg = SHADOWCON;
bits = SHADOWCON_WINx_PROTECT(win);
} else {
reg = PRTCON;
bits = PRTCON_PROTECT;
}
val = readl(ctx->regs + reg);
if (protect)
val |= bits;
else
val &= ~bits;
writel(val, ctx->regs + reg);
}
static void fimd_win_commit(struct device *dev, int zpos) static void fimd_win_commit(struct device *dev, int zpos)
{ {
struct fimd_context *ctx = get_fimd_context(dev); struct fimd_context *ctx = get_fimd_context(dev);
...@@ -498,21 +520,19 @@ static void fimd_win_commit(struct device *dev, int zpos) ...@@ -498,21 +520,19 @@ static void fimd_win_commit(struct device *dev, int zpos)
unsigned int last_x; unsigned int last_x;
unsigned int last_y; unsigned int last_y;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ctx->suspended) if (ctx->suspended)
return; return;
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = ctx->default_win; win = ctx->default_win;
if (win < 0 || win > WINDOWS_NR) if (win < 0 || win >= WINDOWS_NR)
return; return;
win_data = &ctx->win_data[win]; win_data = &ctx->win_data[win];
/* /*
* SHADOWCON register is used for enabling timing. * SHADOWCON/PRTCON register is used for enabling timing.
* *
* for example, once only width value of a register is set, * for example, once only width value of a register is set,
* if the dma is started then fimd hardware could malfunction so * if the dma is started then fimd hardware could malfunction so
...@@ -522,9 +542,7 @@ static void fimd_win_commit(struct device *dev, int zpos) ...@@ -522,9 +542,7 @@ static void fimd_win_commit(struct device *dev, int zpos)
*/ */
/* protect windows */ /* protect windows */
val = readl(ctx->regs + SHADOWCON); fimd_shadow_protect_win(ctx, win, true);
val |= SHADOWCON_WINx_PROTECT(win);
writel(val, ctx->regs + SHADOWCON);
/* buffer start address */ /* buffer start address */
val = (unsigned long)win_data->dma_addr; val = (unsigned long)win_data->dma_addr;
...@@ -602,10 +620,13 @@ static void fimd_win_commit(struct device *dev, int zpos) ...@@ -602,10 +620,13 @@ static void fimd_win_commit(struct device *dev, int zpos)
writel(val, ctx->regs + WINCON(win)); writel(val, ctx->regs + WINCON(win));
/* Enable DMA channel and unprotect windows */ /* Enable DMA channel and unprotect windows */
fimd_shadow_protect_win(ctx, win, false);
if (ctx->driver_data->has_shadowcon) {
val = readl(ctx->regs + SHADOWCON); val = readl(ctx->regs + SHADOWCON);
val |= SHADOWCON_CHx_ENABLE(win); val |= SHADOWCON_CHx_ENABLE(win);
val &= ~SHADOWCON_WINx_PROTECT(win);
writel(val, ctx->regs + SHADOWCON); writel(val, ctx->regs + SHADOWCON);
}
win_data->enabled = true; win_data->enabled = true;
} }
...@@ -617,12 +638,10 @@ static void fimd_win_disable(struct device *dev, int zpos) ...@@ -617,12 +638,10 @@ static void fimd_win_disable(struct device *dev, int zpos)
int win = zpos; int win = zpos;
u32 val; u32 val;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = ctx->default_win; win = ctx->default_win;
if (win < 0 || win > WINDOWS_NR) if (win < 0 || win >= WINDOWS_NR)
return; return;
win_data = &ctx->win_data[win]; win_data = &ctx->win_data[win];
...@@ -634,9 +653,7 @@ static void fimd_win_disable(struct device *dev, int zpos) ...@@ -634,9 +653,7 @@ static void fimd_win_disable(struct device *dev, int zpos)
} }
/* protect windows */ /* protect windows */
val = readl(ctx->regs + SHADOWCON); fimd_shadow_protect_win(ctx, win, true);
val |= SHADOWCON_WINx_PROTECT(win);
writel(val, ctx->regs + SHADOWCON);
/* wincon */ /* wincon */
val = readl(ctx->regs + WINCON(win)); val = readl(ctx->regs + WINCON(win));
...@@ -644,10 +661,13 @@ static void fimd_win_disable(struct device *dev, int zpos) ...@@ -644,10 +661,13 @@ static void fimd_win_disable(struct device *dev, int zpos)
writel(val, ctx->regs + WINCON(win)); writel(val, ctx->regs + WINCON(win));
/* unprotect windows */ /* unprotect windows */
if (ctx->driver_data->has_shadowcon) {
val = readl(ctx->regs + SHADOWCON); val = readl(ctx->regs + SHADOWCON);
val &= ~SHADOWCON_CHx_ENABLE(win); val &= ~SHADOWCON_CHx_ENABLE(win);
val &= ~SHADOWCON_WINx_PROTECT(win);
writel(val, ctx->regs + SHADOWCON); writel(val, ctx->regs + SHADOWCON);
}
fimd_shadow_protect_win(ctx, win, false);
win_data->enabled = false; win_data->enabled = false;
} }
...@@ -697,8 +717,6 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) ...@@ -697,8 +717,6 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev) static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* enable drm irq mode. * enable drm irq mode.
* - with irq_enabled = 1, we can use the vblank feature. * - with irq_enabled = 1, we can use the vblank feature.
...@@ -725,8 +743,6 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ...@@ -725,8 +743,6 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
static void fimd_subdrv_remove(struct drm_device *drm_dev, struct device *dev) static void fimd_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* detach this sub driver from iommu mapping if supported. */ /* detach this sub driver from iommu mapping if supported. */
if (is_drm_iommu_supported(drm_dev)) if (is_drm_iommu_supported(drm_dev))
drm_iommu_detach_device(drm_dev, dev); drm_iommu_detach_device(drm_dev, dev);
...@@ -741,8 +757,6 @@ static int fimd_calc_clkdiv(struct fimd_context *ctx, ...@@ -741,8 +757,6 @@ static int fimd_calc_clkdiv(struct fimd_context *ctx,
u32 best_framerate = 0; u32 best_framerate = 0;
u32 framerate; u32 framerate;
DRM_DEBUG_KMS("%s\n", __FILE__);
retrace = timing->left_margin + timing->hsync_len + retrace = timing->left_margin + timing->hsync_len +
timing->right_margin + timing->xres; timing->right_margin + timing->xres;
retrace *= timing->upper_margin + timing->vsync_len + retrace *= timing->upper_margin + timing->vsync_len +
...@@ -777,10 +791,6 @@ static int fimd_calc_clkdiv(struct fimd_context *ctx, ...@@ -777,10 +791,6 @@ static int fimd_calc_clkdiv(struct fimd_context *ctx,
static void fimd_clear_win(struct fimd_context *ctx, int win) static void fimd_clear_win(struct fimd_context *ctx, int win)
{ {
u32 val;
DRM_DEBUG_KMS("%s\n", __FILE__);
writel(0, ctx->regs + WINCON(win)); writel(0, ctx->regs + WINCON(win));
writel(0, ctx->regs + VIDOSD_A(win)); writel(0, ctx->regs + VIDOSD_A(win));
writel(0, ctx->regs + VIDOSD_B(win)); writel(0, ctx->regs + VIDOSD_B(win));
...@@ -789,15 +799,11 @@ static void fimd_clear_win(struct fimd_context *ctx, int win) ...@@ -789,15 +799,11 @@ static void fimd_clear_win(struct fimd_context *ctx, int win)
if (win == 1 || win == 2) if (win == 1 || win == 2)
writel(0, ctx->regs + VIDOSD_D(win)); writel(0, ctx->regs + VIDOSD_D(win));
val = readl(ctx->regs + SHADOWCON); fimd_shadow_protect_win(ctx, win, false);
val &= ~SHADOWCON_WINx_PROTECT(win);
writel(val, ctx->regs + SHADOWCON);
} }
static int fimd_clock(struct fimd_context *ctx, bool enable) static int fimd_clock(struct fimd_context *ctx, bool enable)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
if (enable) { if (enable) {
int ret; int ret;
...@@ -883,8 +889,6 @@ static int fimd_probe(struct platform_device *pdev) ...@@ -883,8 +889,6 @@ static int fimd_probe(struct platform_device *pdev)
int win; int win;
int ret = -EINVAL; int ret = -EINVAL;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (dev->of_node) { if (dev->of_node) {
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) { if (!pdata) {
...@@ -949,6 +953,7 @@ static int fimd_probe(struct platform_device *pdev) ...@@ -949,6 +953,7 @@ static int fimd_probe(struct platform_device *pdev)
return ret; return ret;
} }
ctx->driver_data = drm_fimd_get_driver_data(pdev);
ctx->vidcon0 = pdata->vidcon0; ctx->vidcon0 = pdata->vidcon0;
ctx->vidcon1 = pdata->vidcon1; ctx->vidcon1 = pdata->vidcon1;
ctx->default_win = pdata->default_win; ctx->default_win = pdata->default_win;
...@@ -989,8 +994,6 @@ static int fimd_remove(struct platform_device *pdev) ...@@ -989,8 +994,6 @@ static int fimd_remove(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct fimd_context *ctx = platform_get_drvdata(pdev); struct fimd_context *ctx = platform_get_drvdata(pdev);
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_drm_subdrv_unregister(&ctx->subdrv); exynos_drm_subdrv_unregister(&ctx->subdrv);
if (ctx->suspended) if (ctx->suspended)
...@@ -1055,8 +1058,6 @@ static int fimd_runtime_suspend(struct device *dev) ...@@ -1055,8 +1058,6 @@ static int fimd_runtime_suspend(struct device *dev)
{ {
struct fimd_context *ctx = get_fimd_context(dev); struct fimd_context *ctx = get_fimd_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
return fimd_activate(ctx, false); return fimd_activate(ctx, false);
} }
...@@ -1064,14 +1065,15 @@ static int fimd_runtime_resume(struct device *dev) ...@@ -1064,14 +1065,15 @@ static int fimd_runtime_resume(struct device *dev)
{ {
struct fimd_context *ctx = get_fimd_context(dev); struct fimd_context *ctx = get_fimd_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
return fimd_activate(ctx, true); return fimd_activate(ctx, true);
} }
#endif #endif
static struct platform_device_id fimd_driver_ids[] = { static struct platform_device_id fimd_driver_ids[] = {
{ {
.name = "s3c64xx-fb",
.driver_data = (unsigned long)&s3c64xx_fimd_driver_data,
}, {
.name = "exynos4-fb", .name = "exynos4-fb",
.driver_data = (unsigned long)&exynos4_fimd_driver_data, .driver_data = (unsigned long)&exynos4_fimd_driver_data,
}, { }, {
......
...@@ -132,8 +132,6 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj) ...@@ -132,8 +132,6 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj)
struct drm_gem_object *obj; struct drm_gem_object *obj;
struct exynos_drm_gem_buf *buf; struct exynos_drm_gem_buf *buf;
DRM_DEBUG_KMS("%s\n", __FILE__);
obj = &exynos_gem_obj->base; obj = &exynos_gem_obj->base;
buf = exynos_gem_obj->buffer; buf = exynos_gem_obj->buffer;
...@@ -227,7 +225,6 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, ...@@ -227,7 +225,6 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
} }
size = roundup_gem_size(size, flags); size = roundup_gem_size(size, flags);
DRM_DEBUG_KMS("%s\n", __FILE__);
ret = check_gem_flags(flags); ret = check_gem_flags(flags);
if (ret) if (ret)
...@@ -268,8 +265,6 @@ int exynos_drm_gem_create_ioctl(struct drm_device *dev, void *data, ...@@ -268,8 +265,6 @@ int exynos_drm_gem_create_ioctl(struct drm_device *dev, void *data,
struct exynos_drm_gem_obj *exynos_gem_obj; struct exynos_drm_gem_obj *exynos_gem_obj;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_gem_obj = exynos_drm_gem_create(dev, args->flags, args->size); exynos_gem_obj = exynos_drm_gem_create(dev, args->flags, args->size);
if (IS_ERR(exynos_gem_obj)) if (IS_ERR(exynos_gem_obj))
return PTR_ERR(exynos_gem_obj); return PTR_ERR(exynos_gem_obj);
...@@ -331,8 +326,6 @@ int exynos_drm_gem_map_offset_ioctl(struct drm_device *dev, void *data, ...@@ -331,8 +326,6 @@ int exynos_drm_gem_map_offset_ioctl(struct drm_device *dev, void *data,
{ {
struct drm_exynos_gem_map_off *args = data; struct drm_exynos_gem_map_off *args = data;
DRM_DEBUG_KMS("%s\n", __FILE__);
DRM_DEBUG_KMS("handle = 0x%x, offset = 0x%lx\n", DRM_DEBUG_KMS("handle = 0x%x, offset = 0x%lx\n",
args->handle, (unsigned long)args->offset); args->handle, (unsigned long)args->offset);
...@@ -371,8 +364,6 @@ static int exynos_drm_gem_mmap_buffer(struct file *filp, ...@@ -371,8 +364,6 @@ static int exynos_drm_gem_mmap_buffer(struct file *filp,
unsigned long vm_size; unsigned long vm_size;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_private_data = obj; vma->vm_private_data = obj;
vma->vm_ops = drm_dev->driver->gem_vm_ops; vma->vm_ops = drm_dev->driver->gem_vm_ops;
...@@ -429,9 +420,7 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, ...@@ -429,9 +420,7 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data,
{ {
struct drm_exynos_gem_mmap *args = data; struct drm_exynos_gem_mmap *args = data;
struct drm_gem_object *obj; struct drm_gem_object *obj;
unsigned int addr; unsigned long addr;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!(dev->driver->driver_features & DRIVER_GEM)) { if (!(dev->driver->driver_features & DRIVER_GEM)) {
DRM_ERROR("does not support GEM.\n"); DRM_ERROR("does not support GEM.\n");
...@@ -473,14 +462,14 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, ...@@ -473,14 +462,14 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data,
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
if (IS_ERR((void *)addr)) { if (IS_ERR_VALUE(addr)) {
/* check filp->f_op, filp->private_data are restored */ /* check filp->f_op, filp->private_data are restored */
if (file_priv->filp->f_op == &exynos_drm_gem_fops) { if (file_priv->filp->f_op == &exynos_drm_gem_fops) {
file_priv->filp->f_op = fops_get(dev->driver->fops); file_priv->filp->f_op = fops_get(dev->driver->fops);
file_priv->filp->private_data = file_priv; file_priv->filp->private_data = file_priv;
} }
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return PTR_ERR((void *)addr); return (int)addr;
} }
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
...@@ -643,8 +632,6 @@ void exynos_gem_unmap_sgt_from_dma(struct drm_device *drm_dev, ...@@ -643,8 +632,6 @@ void exynos_gem_unmap_sgt_from_dma(struct drm_device *drm_dev,
int exynos_drm_gem_init_object(struct drm_gem_object *obj) int exynos_drm_gem_init_object(struct drm_gem_object *obj)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
return 0; return 0;
} }
...@@ -653,8 +640,6 @@ void exynos_drm_gem_free_object(struct drm_gem_object *obj) ...@@ -653,8 +640,6 @@ void exynos_drm_gem_free_object(struct drm_gem_object *obj)
struct exynos_drm_gem_obj *exynos_gem_obj; struct exynos_drm_gem_obj *exynos_gem_obj;
struct exynos_drm_gem_buf *buf; struct exynos_drm_gem_buf *buf;
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_gem_obj = to_exynos_gem_obj(obj); exynos_gem_obj = to_exynos_gem_obj(obj);
buf = exynos_gem_obj->buffer; buf = exynos_gem_obj->buffer;
...@@ -671,8 +656,6 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, ...@@ -671,8 +656,6 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
struct exynos_drm_gem_obj *exynos_gem_obj; struct exynos_drm_gem_obj *exynos_gem_obj;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* alocate memory to be used for framebuffer. * alocate memory to be used for framebuffer.
* - this callback would be called by user application * - this callback would be called by user application
...@@ -704,8 +687,6 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv, ...@@ -704,8 +687,6 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
struct drm_gem_object *obj; struct drm_gem_object *obj;
int ret = 0; int ret = 0;
DRM_DEBUG_KMS("%s\n", __FILE__);
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
/* /*
...@@ -743,8 +724,6 @@ int exynos_drm_gem_dumb_destroy(struct drm_file *file_priv, ...@@ -743,8 +724,6 @@ int exynos_drm_gem_dumb_destroy(struct drm_file *file_priv,
{ {
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* obj->refcount and obj->handle_count are decreased and * obj->refcount and obj->handle_count are decreased and
* if both them are 0 then exynos_drm_gem_free_object() * if both them are 0 then exynos_drm_gem_free_object()
...@@ -788,8 +767,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -788,8 +767,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
struct drm_gem_object *obj; struct drm_gem_object *obj;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* set vm_area_struct. */ /* set vm_area_struct. */
ret = drm_gem_mmap(filp, vma); ret = drm_gem_mmap(filp, vma);
if (ret < 0) { if (ret < 0) {
......
...@@ -400,8 +400,6 @@ static int gsc_sw_reset(struct gsc_context *ctx) ...@@ -400,8 +400,6 @@ static int gsc_sw_reset(struct gsc_context *ctx)
u32 cfg; u32 cfg;
int count = GSC_RESET_TIMEOUT; int count = GSC_RESET_TIMEOUT;
DRM_DEBUG_KMS("%s\n", __func__);
/* s/w reset */ /* s/w reset */
cfg = (GSC_SW_RESET_SRESET); cfg = (GSC_SW_RESET_SRESET);
gsc_write(cfg, GSC_SW_RESET); gsc_write(cfg, GSC_SW_RESET);
...@@ -441,8 +439,6 @@ static void gsc_set_gscblk_fimd_wb(struct gsc_context *ctx, bool enable) ...@@ -441,8 +439,6 @@ static void gsc_set_gscblk_fimd_wb(struct gsc_context *ctx, bool enable)
{ {
u32 gscblk_cfg; u32 gscblk_cfg;
DRM_DEBUG_KMS("%s\n", __func__);
gscblk_cfg = readl(SYSREG_GSCBLK_CFG1); gscblk_cfg = readl(SYSREG_GSCBLK_CFG1);
if (enable) if (enable)
...@@ -460,7 +456,7 @@ static void gsc_handle_irq(struct gsc_context *ctx, bool enable, ...@@ -460,7 +456,7 @@ static void gsc_handle_irq(struct gsc_context *ctx, bool enable,
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:enable[%d]overflow[%d]level[%d]\n", __func__, DRM_DEBUG_KMS("enable[%d]overflow[%d]level[%d]\n",
enable, overflow, done); enable, overflow, done);
cfg = gsc_read(GSC_IRQ); cfg = gsc_read(GSC_IRQ);
...@@ -491,7 +487,7 @@ static int gsc_src_set_fmt(struct device *dev, u32 fmt) ...@@ -491,7 +487,7 @@ static int gsc_src_set_fmt(struct device *dev, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt); DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
cfg = gsc_read(GSC_IN_CON); cfg = gsc_read(GSC_IN_CON);
cfg &= ~(GSC_IN_RGB_TYPE_MASK | GSC_IN_YUV422_1P_ORDER_MASK | cfg &= ~(GSC_IN_RGB_TYPE_MASK | GSC_IN_YUV422_1P_ORDER_MASK |
...@@ -567,8 +563,7 @@ static int gsc_src_set_transf(struct device *dev, ...@@ -567,8 +563,7 @@ static int gsc_src_set_transf(struct device *dev,
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__, DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
degree, flip);
cfg = gsc_read(GSC_IN_CON); cfg = gsc_read(GSC_IN_CON);
cfg &= ~GSC_IN_ROT_MASK; cfg &= ~GSC_IN_ROT_MASK;
...@@ -616,8 +611,8 @@ static int gsc_src_set_size(struct device *dev, int swap, ...@@ -616,8 +611,8 @@ static int gsc_src_set_size(struct device *dev, int swap,
struct gsc_scaler *sc = &ctx->sc; struct gsc_scaler *sc = &ctx->sc;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:swap[%d]x[%d]y[%d]w[%d]h[%d]\n", DRM_DEBUG_KMS("swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
__func__, swap, pos->x, pos->y, pos->w, pos->h); swap, pos->x, pos->y, pos->w, pos->h);
if (swap) { if (swap) {
img_pos.w = pos->h; img_pos.w = pos->h;
...@@ -634,8 +629,7 @@ static int gsc_src_set_size(struct device *dev, int swap, ...@@ -634,8 +629,7 @@ static int gsc_src_set_size(struct device *dev, int swap,
GSC_CROPPED_HEIGHT(img_pos.h)); GSC_CROPPED_HEIGHT(img_pos.h));
gsc_write(cfg, GSC_CROPPED_SIZE); gsc_write(cfg, GSC_CROPPED_SIZE);
DRM_DEBUG_KMS("%s:hsize[%d]vsize[%d]\n", DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", sz->hsize, sz->vsize);
__func__, sz->hsize, sz->vsize);
/* original size */ /* original size */
cfg = gsc_read(GSC_SRCIMG_SIZE); cfg = gsc_read(GSC_SRCIMG_SIZE);
...@@ -650,8 +644,7 @@ static int gsc_src_set_size(struct device *dev, int swap, ...@@ -650,8 +644,7 @@ static int gsc_src_set_size(struct device *dev, int swap,
cfg = gsc_read(GSC_IN_CON); cfg = gsc_read(GSC_IN_CON);
cfg &= ~GSC_IN_RGB_TYPE_MASK; cfg &= ~GSC_IN_RGB_TYPE_MASK;
DRM_DEBUG_KMS("%s:width[%d]range[%d]\n", DRM_DEBUG_KMS("width[%d]range[%d]\n", pos->w, sc->range);
__func__, pos->w, sc->range);
if (pos->w >= GSC_WIDTH_ITU_709) if (pos->w >= GSC_WIDTH_ITU_709)
if (sc->range) if (sc->range)
...@@ -677,8 +670,7 @@ static int gsc_src_set_buf_seq(struct gsc_context *ctx, u32 buf_id, ...@@ -677,8 +670,7 @@ static int gsc_src_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
u32 cfg; u32 cfg;
u32 mask = 0x00000001 << buf_id; u32 mask = 0x00000001 << buf_id;
DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__, DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);
buf_id, buf_type);
/* mask register set */ /* mask register set */
cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK); cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK);
...@@ -721,7 +713,7 @@ static int gsc_src_set_addr(struct device *dev, ...@@ -721,7 +713,7 @@ static int gsc_src_set_addr(struct device *dev,
property = &c_node->property; property = &c_node->property;
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type); property->prop_id, buf_id, buf_type);
if (buf_id > GSC_MAX_SRC) { if (buf_id > GSC_MAX_SRC) {
...@@ -765,7 +757,7 @@ static int gsc_dst_set_fmt(struct device *dev, u32 fmt) ...@@ -765,7 +757,7 @@ static int gsc_dst_set_fmt(struct device *dev, u32 fmt)
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt); DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
cfg = gsc_read(GSC_OUT_CON); cfg = gsc_read(GSC_OUT_CON);
cfg &= ~(GSC_OUT_RGB_TYPE_MASK | GSC_OUT_YUV422_1P_ORDER_MASK | cfg &= ~(GSC_OUT_RGB_TYPE_MASK | GSC_OUT_YUV422_1P_ORDER_MASK |
...@@ -838,8 +830,7 @@ static int gsc_dst_set_transf(struct device *dev, ...@@ -838,8 +830,7 @@ static int gsc_dst_set_transf(struct device *dev,
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__, DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
degree, flip);
cfg = gsc_read(GSC_IN_CON); cfg = gsc_read(GSC_IN_CON);
cfg &= ~GSC_IN_ROT_MASK; cfg &= ~GSC_IN_ROT_MASK;
...@@ -881,7 +872,7 @@ static int gsc_dst_set_transf(struct device *dev, ...@@ -881,7 +872,7 @@ static int gsc_dst_set_transf(struct device *dev,
static int gsc_get_ratio_shift(u32 src, u32 dst, u32 *ratio) static int gsc_get_ratio_shift(u32 src, u32 dst, u32 *ratio)
{ {
DRM_DEBUG_KMS("%s:src[%d]dst[%d]\n", __func__, src, dst); DRM_DEBUG_KMS("src[%d]dst[%d]\n", src, dst);
if (src >= dst * 8) { if (src >= dst * 8) {
DRM_ERROR("failed to make ratio and shift.\n"); DRM_ERROR("failed to make ratio and shift.\n");
...@@ -944,20 +935,19 @@ static int gsc_set_prescaler(struct gsc_context *ctx, struct gsc_scaler *sc, ...@@ -944,20 +935,19 @@ static int gsc_set_prescaler(struct gsc_context *ctx, struct gsc_scaler *sc,
return ret; return ret;
} }
DRM_DEBUG_KMS("%s:pre_hratio[%d]pre_vratio[%d]\n", DRM_DEBUG_KMS("pre_hratio[%d]pre_vratio[%d]\n",
__func__, sc->pre_hratio, sc->pre_vratio); sc->pre_hratio, sc->pre_vratio);
sc->main_hratio = (src_w << 16) / dst_w; sc->main_hratio = (src_w << 16) / dst_w;
sc->main_vratio = (src_h << 16) / dst_h; sc->main_vratio = (src_h << 16) / dst_h;
DRM_DEBUG_KMS("%s:main_hratio[%ld]main_vratio[%ld]\n", DRM_DEBUG_KMS("main_hratio[%ld]main_vratio[%ld]\n",
__func__, sc->main_hratio, sc->main_vratio); sc->main_hratio, sc->main_vratio);
gsc_get_prescaler_shfactor(sc->pre_hratio, sc->pre_vratio, gsc_get_prescaler_shfactor(sc->pre_hratio, sc->pre_vratio,
&sc->pre_shfactor); &sc->pre_shfactor);
DRM_DEBUG_KMS("%s:pre_shfactor[%d]\n", __func__, DRM_DEBUG_KMS("pre_shfactor[%d]\n", sc->pre_shfactor);
sc->pre_shfactor);
cfg = (GSC_PRESC_SHFACTOR(sc->pre_shfactor) | cfg = (GSC_PRESC_SHFACTOR(sc->pre_shfactor) |
GSC_PRESC_H_RATIO(sc->pre_hratio) | GSC_PRESC_H_RATIO(sc->pre_hratio) |
...@@ -1023,8 +1013,8 @@ static void gsc_set_scaler(struct gsc_context *ctx, struct gsc_scaler *sc) ...@@ -1023,8 +1013,8 @@ static void gsc_set_scaler(struct gsc_context *ctx, struct gsc_scaler *sc)
{ {
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:main_hratio[%ld]main_vratio[%ld]\n", DRM_DEBUG_KMS("main_hratio[%ld]main_vratio[%ld]\n",
__func__, sc->main_hratio, sc->main_vratio); sc->main_hratio, sc->main_vratio);
gsc_set_h_coef(ctx, sc->main_hratio); gsc_set_h_coef(ctx, sc->main_hratio);
cfg = GSC_MAIN_H_RATIO_VALUE(sc->main_hratio); cfg = GSC_MAIN_H_RATIO_VALUE(sc->main_hratio);
...@@ -1043,8 +1033,8 @@ static int gsc_dst_set_size(struct device *dev, int swap, ...@@ -1043,8 +1033,8 @@ static int gsc_dst_set_size(struct device *dev, int swap,
struct gsc_scaler *sc = &ctx->sc; struct gsc_scaler *sc = &ctx->sc;
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:swap[%d]x[%d]y[%d]w[%d]h[%d]\n", DRM_DEBUG_KMS("swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
__func__, swap, pos->x, pos->y, pos->w, pos->h); swap, pos->x, pos->y, pos->w, pos->h);
if (swap) { if (swap) {
img_pos.w = pos->h; img_pos.w = pos->h;
...@@ -1060,8 +1050,7 @@ static int gsc_dst_set_size(struct device *dev, int swap, ...@@ -1060,8 +1050,7 @@ static int gsc_dst_set_size(struct device *dev, int swap,
cfg = (GSC_SCALED_WIDTH(img_pos.w) | GSC_SCALED_HEIGHT(img_pos.h)); cfg = (GSC_SCALED_WIDTH(img_pos.w) | GSC_SCALED_HEIGHT(img_pos.h));
gsc_write(cfg, GSC_SCALED_SIZE); gsc_write(cfg, GSC_SCALED_SIZE);
DRM_DEBUG_KMS("%s:hsize[%d]vsize[%d]\n", DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", sz->hsize, sz->vsize);
__func__, sz->hsize, sz->vsize);
/* original size */ /* original size */
cfg = gsc_read(GSC_DSTIMG_SIZE); cfg = gsc_read(GSC_DSTIMG_SIZE);
...@@ -1074,8 +1063,7 @@ static int gsc_dst_set_size(struct device *dev, int swap, ...@@ -1074,8 +1063,7 @@ static int gsc_dst_set_size(struct device *dev, int swap,
cfg = gsc_read(GSC_OUT_CON); cfg = gsc_read(GSC_OUT_CON);
cfg &= ~GSC_OUT_RGB_TYPE_MASK; cfg &= ~GSC_OUT_RGB_TYPE_MASK;
DRM_DEBUG_KMS("%s:width[%d]range[%d]\n", DRM_DEBUG_KMS("width[%d]range[%d]\n", pos->w, sc->range);
__func__, pos->w, sc->range);
if (pos->w >= GSC_WIDTH_ITU_709) if (pos->w >= GSC_WIDTH_ITU_709)
if (sc->range) if (sc->range)
...@@ -1104,7 +1092,7 @@ static int gsc_dst_get_buf_seq(struct gsc_context *ctx) ...@@ -1104,7 +1092,7 @@ static int gsc_dst_get_buf_seq(struct gsc_context *ctx)
if (cfg & (mask << i)) if (cfg & (mask << i))
buf_num--; buf_num--;
DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num); DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);
return buf_num; return buf_num;
} }
...@@ -1118,8 +1106,7 @@ static int gsc_dst_set_buf_seq(struct gsc_context *ctx, u32 buf_id, ...@@ -1118,8 +1106,7 @@ static int gsc_dst_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
u32 mask = 0x00000001 << buf_id; u32 mask = 0x00000001 << buf_id;
int ret = 0; int ret = 0;
DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__, DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);
buf_id, buf_type);
mutex_lock(&ctx->lock); mutex_lock(&ctx->lock);
...@@ -1177,7 +1164,7 @@ static int gsc_dst_set_addr(struct device *dev, ...@@ -1177,7 +1164,7 @@ static int gsc_dst_set_addr(struct device *dev,
property = &c_node->property; property = &c_node->property;
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type); property->prop_id, buf_id, buf_type);
if (buf_id > GSC_MAX_DST) { if (buf_id > GSC_MAX_DST) {
...@@ -1217,7 +1204,7 @@ static struct exynos_drm_ipp_ops gsc_dst_ops = { ...@@ -1217,7 +1204,7 @@ static struct exynos_drm_ipp_ops gsc_dst_ops = {
static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable) static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable)
{ {
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable); DRM_DEBUG_KMS("enable[%d]\n", enable);
if (enable) { if (enable) {
clk_enable(ctx->gsc_clk); clk_enable(ctx->gsc_clk);
...@@ -1236,7 +1223,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx) ...@@ -1236,7 +1223,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx)
u32 buf_id = GSC_MAX_SRC; u32 buf_id = GSC_MAX_SRC;
int ret; int ret;
DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);
cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK); cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK);
curr_index = GSC_IN_CURR_GET_INDEX(cfg); curr_index = GSC_IN_CURR_GET_INDEX(cfg);
...@@ -1259,7 +1246,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx) ...@@ -1259,7 +1246,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx)
return ret; return ret;
} }
DRM_DEBUG_KMS("%s:cfg[0x%x]curr_index[%d]buf_id[%d]\n", __func__, cfg, DRM_DEBUG_KMS("cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg,
curr_index, buf_id); curr_index, buf_id);
return buf_id; return buf_id;
...@@ -1271,7 +1258,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx) ...@@ -1271,7 +1258,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx)
u32 buf_id = GSC_MAX_DST; u32 buf_id = GSC_MAX_DST;
int ret; int ret;
DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);
cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK); cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK);
curr_index = GSC_OUT_CURR_GET_INDEX(cfg); curr_index = GSC_OUT_CURR_GET_INDEX(cfg);
...@@ -1294,7 +1281,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx) ...@@ -1294,7 +1281,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx)
return ret; return ret;
} }
DRM_DEBUG_KMS("%s:cfg[0x%x]curr_index[%d]buf_id[%d]\n", __func__, cfg, DRM_DEBUG_KMS("cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg,
curr_index, buf_id); curr_index, buf_id);
return buf_id; return buf_id;
...@@ -1310,7 +1297,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) ...@@ -1310,7 +1297,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
u32 status; u32 status;
int buf_id[EXYNOS_DRM_OPS_MAX]; int buf_id[EXYNOS_DRM_OPS_MAX];
DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);
status = gsc_read(GSC_IRQ); status = gsc_read(GSC_IRQ);
if (status & GSC_IRQ_STATUS_OR_IRQ) { if (status & GSC_IRQ_STATUS_OR_IRQ) {
...@@ -1331,7 +1318,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) ...@@ -1331,7 +1318,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
if (buf_id[EXYNOS_DRM_OPS_DST] < 0) if (buf_id[EXYNOS_DRM_OPS_DST] < 0)
return IRQ_HANDLED; return IRQ_HANDLED;
DRM_DEBUG_KMS("%s:buf_id_src[%d]buf_id_dst[%d]\n", __func__, DRM_DEBUG_KMS("buf_id_src[%d]buf_id_dst[%d]\n",
buf_id[EXYNOS_DRM_OPS_SRC], buf_id[EXYNOS_DRM_OPS_DST]); buf_id[EXYNOS_DRM_OPS_SRC], buf_id[EXYNOS_DRM_OPS_DST]);
event_work->ippdrv = ippdrv; event_work->ippdrv = ippdrv;
...@@ -1350,8 +1337,6 @@ static int gsc_init_prop_list(struct exynos_drm_ippdrv *ippdrv) ...@@ -1350,8 +1337,6 @@ static int gsc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
{ {
struct drm_exynos_ipp_prop_list *prop_list; struct drm_exynos_ipp_prop_list *prop_list;
DRM_DEBUG_KMS("%s\n", __func__);
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL); prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
if (!prop_list) { if (!prop_list) {
DRM_ERROR("failed to alloc property list.\n"); DRM_ERROR("failed to alloc property list.\n");
...@@ -1394,7 +1379,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip) ...@@ -1394,7 +1379,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip)
case EXYNOS_DRM_FLIP_BOTH: case EXYNOS_DRM_FLIP_BOTH:
return true; return true;
default: default:
DRM_DEBUG_KMS("%s:invalid flip\n", __func__); DRM_DEBUG_KMS("invalid flip\n");
return false; return false;
} }
} }
...@@ -1411,8 +1396,6 @@ static int gsc_ippdrv_check_property(struct device *dev, ...@@ -1411,8 +1396,6 @@ static int gsc_ippdrv_check_property(struct device *dev,
bool swap; bool swap;
int i; int i;
DRM_DEBUG_KMS("%s\n", __func__);
for_each_ipp_ops(i) { for_each_ipp_ops(i) {
if ((i == EXYNOS_DRM_OPS_SRC) && if ((i == EXYNOS_DRM_OPS_SRC) &&
(property->cmd == IPP_CMD_WB)) (property->cmd == IPP_CMD_WB))
...@@ -1521,8 +1504,6 @@ static int gsc_ippdrv_reset(struct device *dev) ...@@ -1521,8 +1504,6 @@ static int gsc_ippdrv_reset(struct device *dev)
struct gsc_scaler *sc = &ctx->sc; struct gsc_scaler *sc = &ctx->sc;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __func__);
/* reset h/w block */ /* reset h/w block */
ret = gsc_sw_reset(ctx); ret = gsc_sw_reset(ctx);
if (ret < 0) { if (ret < 0) {
...@@ -1549,7 +1530,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) ...@@ -1549,7 +1530,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
u32 cfg; u32 cfg;
int ret, i; int ret, i;
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd); DRM_DEBUG_KMS("cmd[%d]\n", cmd);
if (!c_node) { if (!c_node) {
DRM_ERROR("failed to get c_node.\n"); DRM_ERROR("failed to get c_node.\n");
...@@ -1643,7 +1624,7 @@ static void gsc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd) ...@@ -1643,7 +1624,7 @@ static void gsc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
struct drm_exynos_ipp_set_wb set_wb = {0, 0}; struct drm_exynos_ipp_set_wb set_wb = {0, 0};
u32 cfg; u32 cfg;
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd); DRM_DEBUG_KMS("cmd[%d]\n", cmd);
switch (cmd) { switch (cmd) {
case IPP_CMD_M2M: case IPP_CMD_M2M:
...@@ -1728,8 +1709,7 @@ static int gsc_probe(struct platform_device *pdev) ...@@ -1728,8 +1709,7 @@ static int gsc_probe(struct platform_device *pdev)
return ret; return ret;
} }
DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id, DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv);
(int)ippdrv);
mutex_init(&ctx->lock); mutex_init(&ctx->lock);
platform_set_drvdata(pdev, ctx); platform_set_drvdata(pdev, ctx);
...@@ -1772,7 +1752,7 @@ static int gsc_suspend(struct device *dev) ...@@ -1772,7 +1752,7 @@ static int gsc_suspend(struct device *dev)
{ {
struct gsc_context *ctx = get_gsc_context(dev); struct gsc_context *ctx = get_gsc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
if (pm_runtime_suspended(dev)) if (pm_runtime_suspended(dev))
return 0; return 0;
...@@ -1784,7 +1764,7 @@ static int gsc_resume(struct device *dev) ...@@ -1784,7 +1764,7 @@ static int gsc_resume(struct device *dev)
{ {
struct gsc_context *ctx = get_gsc_context(dev); struct gsc_context *ctx = get_gsc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
if (!pm_runtime_suspended(dev)) if (!pm_runtime_suspended(dev))
return gsc_clk_ctrl(ctx, true); return gsc_clk_ctrl(ctx, true);
...@@ -1798,7 +1778,7 @@ static int gsc_runtime_suspend(struct device *dev) ...@@ -1798,7 +1778,7 @@ static int gsc_runtime_suspend(struct device *dev)
{ {
struct gsc_context *ctx = get_gsc_context(dev); struct gsc_context *ctx = get_gsc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
return gsc_clk_ctrl(ctx, false); return gsc_clk_ctrl(ctx, false);
} }
...@@ -1807,7 +1787,7 @@ static int gsc_runtime_resume(struct device *dev) ...@@ -1807,7 +1787,7 @@ static int gsc_runtime_resume(struct device *dev)
{ {
struct gsc_context *ctx = get_gsc_context(dev); struct gsc_context *ctx = get_gsc_context(dev);
DRM_DEBUG_KMS("%s:id[%d]\n", __FILE__, ctx->id); DRM_DEBUG_KMS("id[%d]\n", ctx->id);
return gsc_clk_ctrl(ctx, true); return gsc_clk_ctrl(ctx, true);
} }
......
...@@ -88,16 +88,12 @@ void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx) ...@@ -88,16 +88,12 @@ void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx)
void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops) void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ops) if (ops)
hdmi_ops = ops; hdmi_ops = ops;
} }
void exynos_mixer_ops_register(struct exynos_mixer_ops *ops) void exynos_mixer_ops_register(struct exynos_mixer_ops *ops)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ops) if (ops)
mixer_ops = ops; mixer_ops = ops;
} }
...@@ -106,8 +102,6 @@ static bool drm_hdmi_is_connected(struct device *dev) ...@@ -106,8 +102,6 @@ static bool drm_hdmi_is_connected(struct device *dev)
{ {
struct drm_hdmi_context *ctx = to_context(dev); struct drm_hdmi_context *ctx = to_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_ops && hdmi_ops->is_connected) if (hdmi_ops && hdmi_ops->is_connected)
return hdmi_ops->is_connected(ctx->hdmi_ctx->ctx); return hdmi_ops->is_connected(ctx->hdmi_ctx->ctx);
...@@ -119,34 +113,31 @@ static struct edid *drm_hdmi_get_edid(struct device *dev, ...@@ -119,34 +113,31 @@ static struct edid *drm_hdmi_get_edid(struct device *dev,
{ {
struct drm_hdmi_context *ctx = to_context(dev); struct drm_hdmi_context *ctx = to_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_ops && hdmi_ops->get_edid) if (hdmi_ops && hdmi_ops->get_edid)
return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector); return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector);
return NULL; return NULL;
} }
static int drm_hdmi_check_timing(struct device *dev, void *timing) static int drm_hdmi_check_mode(struct device *dev,
struct drm_display_mode *mode)
{ {
struct drm_hdmi_context *ctx = to_context(dev); struct drm_hdmi_context *ctx = to_context(dev);
int ret = 0; int ret = 0;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* Both, mixer and hdmi should be able to handle the requested mode. * Both, mixer and hdmi should be able to handle the requested mode.
* If any of the two fails, return mode as BAD. * If any of the two fails, return mode as BAD.
*/ */
if (mixer_ops && mixer_ops->check_timing) if (mixer_ops && mixer_ops->check_mode)
ret = mixer_ops->check_timing(ctx->mixer_ctx->ctx, timing); ret = mixer_ops->check_mode(ctx->mixer_ctx->ctx, mode);
if (ret) if (ret)
return ret; return ret;
if (hdmi_ops && hdmi_ops->check_timing) if (hdmi_ops && hdmi_ops->check_mode)
return hdmi_ops->check_timing(ctx->hdmi_ctx->ctx, timing); return hdmi_ops->check_mode(ctx->hdmi_ctx->ctx, mode);
return 0; return 0;
} }
...@@ -155,8 +146,6 @@ static int drm_hdmi_power_on(struct device *dev, int mode) ...@@ -155,8 +146,6 @@ static int drm_hdmi_power_on(struct device *dev, int mode)
{ {
struct drm_hdmi_context *ctx = to_context(dev); struct drm_hdmi_context *ctx = to_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_ops && hdmi_ops->power_on) if (hdmi_ops && hdmi_ops->power_on)
return hdmi_ops->power_on(ctx->hdmi_ctx->ctx, mode); return hdmi_ops->power_on(ctx->hdmi_ctx->ctx, mode);
...@@ -167,7 +156,7 @@ static struct exynos_drm_display_ops drm_hdmi_display_ops = { ...@@ -167,7 +156,7 @@ static struct exynos_drm_display_ops drm_hdmi_display_ops = {
.type = EXYNOS_DISPLAY_TYPE_HDMI, .type = EXYNOS_DISPLAY_TYPE_HDMI,
.is_connected = drm_hdmi_is_connected, .is_connected = drm_hdmi_is_connected,
.get_edid = drm_hdmi_get_edid, .get_edid = drm_hdmi_get_edid,
.check_timing = drm_hdmi_check_timing, .check_mode = drm_hdmi_check_mode,
.power_on = drm_hdmi_power_on, .power_on = drm_hdmi_power_on,
}; };
...@@ -177,8 +166,6 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev) ...@@ -177,8 +166,6 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)
struct exynos_drm_subdrv *subdrv = &ctx->subdrv; struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
struct exynos_drm_manager *manager = subdrv->manager; struct exynos_drm_manager *manager = subdrv->manager;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (mixer_ops && mixer_ops->enable_vblank) if (mixer_ops && mixer_ops->enable_vblank)
return mixer_ops->enable_vblank(ctx->mixer_ctx->ctx, return mixer_ops->enable_vblank(ctx->mixer_ctx->ctx,
manager->pipe); manager->pipe);
...@@ -190,8 +177,6 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev) ...@@ -190,8 +177,6 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)
{ {
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (mixer_ops && mixer_ops->disable_vblank) if (mixer_ops && mixer_ops->disable_vblank)
return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx); return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx);
} }
...@@ -200,8 +185,6 @@ static void drm_hdmi_wait_for_vblank(struct device *subdrv_dev) ...@@ -200,8 +185,6 @@ static void drm_hdmi_wait_for_vblank(struct device *subdrv_dev)
{ {
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (mixer_ops && mixer_ops->wait_for_vblank) if (mixer_ops && mixer_ops->wait_for_vblank)
mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx); mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx);
} }
...@@ -214,11 +197,9 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev, ...@@ -214,11 +197,9 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
struct drm_display_mode *m; struct drm_display_mode *m;
int mode_ok; int mode_ok;
DRM_DEBUG_KMS("%s\n", __FILE__);
drm_mode_set_crtcinfo(adjusted_mode, 0); drm_mode_set_crtcinfo(adjusted_mode, 0);
mode_ok = drm_hdmi_check_timing(subdrv_dev, adjusted_mode); mode_ok = drm_hdmi_check_mode(subdrv_dev, adjusted_mode);
/* just return if user desired mode exists. */ /* just return if user desired mode exists. */
if (mode_ok == 0) if (mode_ok == 0)
...@@ -229,7 +210,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev, ...@@ -229,7 +210,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
* to adjusted_mode. * to adjusted_mode.
*/ */
list_for_each_entry(m, &connector->modes, head) { list_for_each_entry(m, &connector->modes, head) {
mode_ok = drm_hdmi_check_timing(subdrv_dev, m); mode_ok = drm_hdmi_check_mode(subdrv_dev, m);
if (mode_ok == 0) { if (mode_ok == 0) {
struct drm_mode_object base; struct drm_mode_object base;
...@@ -256,8 +237,6 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) ...@@ -256,8 +237,6 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)
{ {
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_ops && hdmi_ops->mode_set) if (hdmi_ops && hdmi_ops->mode_set)
hdmi_ops->mode_set(ctx->hdmi_ctx->ctx, mode); hdmi_ops->mode_set(ctx->hdmi_ctx->ctx, mode);
} }
...@@ -267,8 +246,6 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev, ...@@ -267,8 +246,6 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
{ {
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_ops && hdmi_ops->get_max_resol) if (hdmi_ops && hdmi_ops->get_max_resol)
hdmi_ops->get_max_resol(ctx->hdmi_ctx->ctx, width, height); hdmi_ops->get_max_resol(ctx->hdmi_ctx->ctx, width, height);
} }
...@@ -277,8 +254,6 @@ static void drm_hdmi_commit(struct device *subdrv_dev) ...@@ -277,8 +254,6 @@ static void drm_hdmi_commit(struct device *subdrv_dev)
{ {
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_ops && hdmi_ops->commit) if (hdmi_ops && hdmi_ops->commit)
hdmi_ops->commit(ctx->hdmi_ctx->ctx); hdmi_ops->commit(ctx->hdmi_ctx->ctx);
} }
...@@ -287,8 +262,6 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) ...@@ -287,8 +262,6 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
{ {
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (mixer_ops && mixer_ops->dpms) if (mixer_ops && mixer_ops->dpms)
mixer_ops->dpms(ctx->mixer_ctx->ctx, mode); mixer_ops->dpms(ctx->mixer_ctx->ctx, mode);
...@@ -301,8 +274,6 @@ static void drm_hdmi_apply(struct device *subdrv_dev) ...@@ -301,8 +274,6 @@ static void drm_hdmi_apply(struct device *subdrv_dev)
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
int i; int i;
DRM_DEBUG_KMS("%s\n", __FILE__);
for (i = 0; i < MIXER_WIN_NR; i++) { for (i = 0; i < MIXER_WIN_NR; i++) {
if (!ctx->enabled[i]) if (!ctx->enabled[i])
continue; continue;
...@@ -331,8 +302,6 @@ static void drm_mixer_mode_set(struct device *subdrv_dev, ...@@ -331,8 +302,6 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,
{ {
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (mixer_ops && mixer_ops->win_mode_set) if (mixer_ops && mixer_ops->win_mode_set)
mixer_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay); mixer_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay);
} }
...@@ -342,9 +311,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) ...@@ -342,9 +311,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
int win = (zpos == DEFAULT_ZPOS) ? MIXER_DEFAULT_WIN : zpos; int win = (zpos == DEFAULT_ZPOS) ? MIXER_DEFAULT_WIN : zpos;
DRM_DEBUG_KMS("%s\n", __FILE__); if (win < 0 || win >= MIXER_WIN_NR) {
if (win < 0 || win > MIXER_WIN_NR) {
DRM_ERROR("mixer window[%d] is wrong\n", win); DRM_ERROR("mixer window[%d] is wrong\n", win);
return; return;
} }
...@@ -360,9 +327,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) ...@@ -360,9 +327,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
struct drm_hdmi_context *ctx = to_context(subdrv_dev); struct drm_hdmi_context *ctx = to_context(subdrv_dev);
int win = (zpos == DEFAULT_ZPOS) ? MIXER_DEFAULT_WIN : zpos; int win = (zpos == DEFAULT_ZPOS) ? MIXER_DEFAULT_WIN : zpos;
DRM_DEBUG_KMS("%s\n", __FILE__); if (win < 0 || win >= MIXER_WIN_NR) {
if (win < 0 || win > MIXER_WIN_NR) {
DRM_ERROR("mixer window[%d] is wrong\n", win); DRM_ERROR("mixer window[%d] is wrong\n", win);
return; return;
} }
...@@ -392,8 +357,6 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev, ...@@ -392,8 +357,6 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
struct exynos_drm_subdrv *subdrv = to_subdrv(dev); struct exynos_drm_subdrv *subdrv = to_subdrv(dev);
struct drm_hdmi_context *ctx; struct drm_hdmi_context *ctx;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!hdmi_ctx) { if (!hdmi_ctx) {
DRM_ERROR("hdmi context not initialized.\n"); DRM_ERROR("hdmi context not initialized.\n");
return -EFAULT; return -EFAULT;
...@@ -440,8 +403,6 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev) ...@@ -440,8 +403,6 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv; struct exynos_drm_subdrv *subdrv;
struct drm_hdmi_context *ctx; struct drm_hdmi_context *ctx;
DRM_DEBUG_KMS("%s\n", __FILE__);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx) { if (!ctx) {
DRM_LOG_KMS("failed to alloc common hdmi context.\n"); DRM_LOG_KMS("failed to alloc common hdmi context.\n");
...@@ -466,8 +427,6 @@ static int exynos_drm_hdmi_remove(struct platform_device *pdev) ...@@ -466,8 +427,6 @@ static int exynos_drm_hdmi_remove(struct platform_device *pdev)
{ {
struct drm_hdmi_context *ctx = platform_get_drvdata(pdev); struct drm_hdmi_context *ctx = platform_get_drvdata(pdev);
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_drm_subdrv_unregister(&ctx->subdrv); exynos_drm_subdrv_unregister(&ctx->subdrv);
return 0; return 0;
......
...@@ -32,11 +32,11 @@ struct exynos_hdmi_ops { ...@@ -32,11 +32,11 @@ struct exynos_hdmi_ops {
bool (*is_connected)(void *ctx); bool (*is_connected)(void *ctx);
struct edid *(*get_edid)(void *ctx, struct edid *(*get_edid)(void *ctx,
struct drm_connector *connector); struct drm_connector *connector);
int (*check_timing)(void *ctx, struct fb_videomode *timing); int (*check_mode)(void *ctx, struct drm_display_mode *mode);
int (*power_on)(void *ctx, int mode); int (*power_on)(void *ctx, int mode);
/* manager */ /* manager */
void (*mode_set)(void *ctx, void *mode); void (*mode_set)(void *ctx, struct drm_display_mode *mode);
void (*get_max_resol)(void *ctx, unsigned int *width, void (*get_max_resol)(void *ctx, unsigned int *width,
unsigned int *height); unsigned int *height);
void (*commit)(void *ctx); void (*commit)(void *ctx);
...@@ -57,7 +57,7 @@ struct exynos_mixer_ops { ...@@ -57,7 +57,7 @@ struct exynos_mixer_ops {
void (*win_disable)(void *ctx, int zpos); void (*win_disable)(void *ctx, int zpos);
/* display */ /* display */
int (*check_timing)(void *ctx, struct fb_videomode *timing); int (*check_mode)(void *ctx, struct drm_display_mode *mode);
}; };
void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx); void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx);
......
...@@ -81,8 +81,6 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -81,8 +81,6 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
int nr; int nr;
int i; int i;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
nr = exynos_drm_fb_get_buf_cnt(fb); nr = exynos_drm_fb_get_buf_cnt(fb);
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
struct exynos_drm_gem_buf *buffer = exynos_drm_fb_buffer(fb, i); struct exynos_drm_gem_buf *buffer = exynos_drm_fb_buffer(fb, i);
...@@ -159,8 +157,6 @@ void exynos_plane_dpms(struct drm_plane *plane, int mode) ...@@ -159,8 +157,6 @@ void exynos_plane_dpms(struct drm_plane *plane, int mode)
struct exynos_plane *exynos_plane = to_exynos_plane(plane); struct exynos_plane *exynos_plane = to_exynos_plane(plane);
struct exynos_drm_overlay *overlay = &exynos_plane->overlay; struct exynos_drm_overlay *overlay = &exynos_plane->overlay;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (mode == DRM_MODE_DPMS_ON) { if (mode == DRM_MODE_DPMS_ON) {
if (exynos_plane->enabled) if (exynos_plane->enabled)
return; return;
...@@ -189,8 +185,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -189,8 +185,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
{ {
int ret; int ret;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
ret = exynos_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, ret = exynos_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y,
crtc_w, crtc_h, src_x >> 16, src_y >> 16, crtc_w, crtc_h, src_x >> 16, src_y >> 16,
src_w >> 16, src_h >> 16); src_w >> 16, src_h >> 16);
...@@ -207,8 +201,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -207,8 +201,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
static int exynos_disable_plane(struct drm_plane *plane) static int exynos_disable_plane(struct drm_plane *plane)
{ {
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
exynos_plane_dpms(plane, DRM_MODE_DPMS_OFF); exynos_plane_dpms(plane, DRM_MODE_DPMS_OFF);
return 0; return 0;
...@@ -218,8 +210,6 @@ static void exynos_plane_destroy(struct drm_plane *plane) ...@@ -218,8 +210,6 @@ static void exynos_plane_destroy(struct drm_plane *plane)
{ {
struct exynos_plane *exynos_plane = to_exynos_plane(plane); struct exynos_plane *exynos_plane = to_exynos_plane(plane);
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
exynos_disable_plane(plane); exynos_disable_plane(plane);
drm_plane_cleanup(plane); drm_plane_cleanup(plane);
kfree(exynos_plane); kfree(exynos_plane);
...@@ -233,8 +223,6 @@ static int exynos_plane_set_property(struct drm_plane *plane, ...@@ -233,8 +223,6 @@ static int exynos_plane_set_property(struct drm_plane *plane,
struct exynos_plane *exynos_plane = to_exynos_plane(plane); struct exynos_plane *exynos_plane = to_exynos_plane(plane);
struct exynos_drm_private *dev_priv = dev->dev_private; struct exynos_drm_private *dev_priv = dev->dev_private;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (property == dev_priv->plane_zpos_property) { if (property == dev_priv->plane_zpos_property) {
exynos_plane->overlay.zpos = val; exynos_plane->overlay.zpos = val;
return 0; return 0;
...@@ -256,8 +244,6 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane) ...@@ -256,8 +244,6 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane)
struct exynos_drm_private *dev_priv = dev->dev_private; struct exynos_drm_private *dev_priv = dev->dev_private;
struct drm_property *prop; struct drm_property *prop;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
prop = dev_priv->plane_zpos_property; prop = dev_priv->plane_zpos_property;
if (!prop) { if (!prop) {
prop = drm_property_create_range(dev, 0, "zpos", 0, prop = drm_property_create_range(dev, 0, "zpos", 0,
...@@ -277,8 +263,6 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev, ...@@ -277,8 +263,6 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev,
struct exynos_plane *exynos_plane; struct exynos_plane *exynos_plane;
int err; int err;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
exynos_plane = kzalloc(sizeof(struct exynos_plane), GFP_KERNEL); exynos_plane = kzalloc(sizeof(struct exynos_plane), GFP_KERNEL);
if (!exynos_plane) { if (!exynos_plane) {
DRM_ERROR("failed to allocate plane\n"); DRM_ERROR("failed to allocate plane\n");
......
...@@ -244,7 +244,7 @@ static int rotator_src_set_size(struct device *dev, int swap, ...@@ -244,7 +244,7 @@ static int rotator_src_set_size(struct device *dev, int swap,
/* Get format */ /* Get format */
fmt = rotator_reg_get_fmt(rot); fmt = rotator_reg_get_fmt(rot);
if (!rotator_check_reg_fmt(fmt)) { if (!rotator_check_reg_fmt(fmt)) {
DRM_ERROR("%s:invalid format.\n", __func__); DRM_ERROR("invalid format.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -287,7 +287,7 @@ static int rotator_src_set_addr(struct device *dev, ...@@ -287,7 +287,7 @@ static int rotator_src_set_addr(struct device *dev,
/* Get format */ /* Get format */
fmt = rotator_reg_get_fmt(rot); fmt = rotator_reg_get_fmt(rot);
if (!rotator_check_reg_fmt(fmt)) { if (!rotator_check_reg_fmt(fmt)) {
DRM_ERROR("%s:invalid format.\n", __func__); DRM_ERROR("invalid format.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -381,7 +381,7 @@ static int rotator_dst_set_size(struct device *dev, int swap, ...@@ -381,7 +381,7 @@ static int rotator_dst_set_size(struct device *dev, int swap,
/* Get format */ /* Get format */
fmt = rotator_reg_get_fmt(rot); fmt = rotator_reg_get_fmt(rot);
if (!rotator_check_reg_fmt(fmt)) { if (!rotator_check_reg_fmt(fmt)) {
DRM_ERROR("%s:invalid format.\n", __func__); DRM_ERROR("invalid format.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -422,7 +422,7 @@ static int rotator_dst_set_addr(struct device *dev, ...@@ -422,7 +422,7 @@ static int rotator_dst_set_addr(struct device *dev,
/* Get format */ /* Get format */
fmt = rotator_reg_get_fmt(rot); fmt = rotator_reg_get_fmt(rot);
if (!rotator_check_reg_fmt(fmt)) { if (!rotator_check_reg_fmt(fmt)) {
DRM_ERROR("%s:invalid format.\n", __func__); DRM_ERROR("invalid format.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -471,8 +471,6 @@ static int rotator_init_prop_list(struct exynos_drm_ippdrv *ippdrv) ...@@ -471,8 +471,6 @@ static int rotator_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
{ {
struct drm_exynos_ipp_prop_list *prop_list; struct drm_exynos_ipp_prop_list *prop_list;
DRM_DEBUG_KMS("%s\n", __func__);
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL); prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
if (!prop_list) { if (!prop_list) {
DRM_ERROR("failed to alloc property list.\n"); DRM_ERROR("failed to alloc property list.\n");
...@@ -502,7 +500,7 @@ static inline bool rotator_check_drm_fmt(u32 fmt) ...@@ -502,7 +500,7 @@ static inline bool rotator_check_drm_fmt(u32 fmt)
case DRM_FORMAT_NV12: case DRM_FORMAT_NV12:
return true; return true;
default: default:
DRM_DEBUG_KMS("%s:not support format\n", __func__); DRM_DEBUG_KMS("not support format\n");
return false; return false;
} }
} }
...@@ -516,7 +514,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) ...@@ -516,7 +514,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip)
case EXYNOS_DRM_FLIP_BOTH: case EXYNOS_DRM_FLIP_BOTH:
return true; return true;
default: default:
DRM_DEBUG_KMS("%s:invalid flip\n", __func__); DRM_DEBUG_KMS("invalid flip\n");
return false; return false;
} }
} }
...@@ -536,19 +534,18 @@ static int rotator_ippdrv_check_property(struct device *dev, ...@@ -536,19 +534,18 @@ static int rotator_ippdrv_check_property(struct device *dev,
/* Check format configuration */ /* Check format configuration */
if (src_config->fmt != dst_config->fmt) { if (src_config->fmt != dst_config->fmt) {
DRM_DEBUG_KMS("%s:not support csc feature\n", __func__); DRM_DEBUG_KMS("not support csc feature\n");
return -EINVAL; return -EINVAL;
} }
if (!rotator_check_drm_fmt(dst_config->fmt)) { if (!rotator_check_drm_fmt(dst_config->fmt)) {
DRM_DEBUG_KMS("%s:invalid format\n", __func__); DRM_DEBUG_KMS("invalid format\n");
return -EINVAL; return -EINVAL;
} }
/* Check transform configuration */ /* Check transform configuration */
if (src_config->degree != EXYNOS_DRM_DEGREE_0) { if (src_config->degree != EXYNOS_DRM_DEGREE_0) {
DRM_DEBUG_KMS("%s:not support source-side rotation\n", DRM_DEBUG_KMS("not support source-side rotation\n");
__func__);
return -EINVAL; return -EINVAL;
} }
...@@ -561,51 +558,47 @@ static int rotator_ippdrv_check_property(struct device *dev, ...@@ -561,51 +558,47 @@ static int rotator_ippdrv_check_property(struct device *dev,
/* No problem */ /* No problem */
break; break;
default: default:
DRM_DEBUG_KMS("%s:invalid degree\n", __func__); DRM_DEBUG_KMS("invalid degree\n");
return -EINVAL; return -EINVAL;
} }
if (src_config->flip != EXYNOS_DRM_FLIP_NONE) { if (src_config->flip != EXYNOS_DRM_FLIP_NONE) {
DRM_DEBUG_KMS("%s:not support source-side flip\n", __func__); DRM_DEBUG_KMS("not support source-side flip\n");
return -EINVAL; return -EINVAL;
} }
if (!rotator_check_drm_flip(dst_config->flip)) { if (!rotator_check_drm_flip(dst_config->flip)) {
DRM_DEBUG_KMS("%s:invalid flip\n", __func__); DRM_DEBUG_KMS("invalid flip\n");
return -EINVAL; return -EINVAL;
} }
/* Check size configuration */ /* Check size configuration */
if ((src_pos->x + src_pos->w > src_sz->hsize) || if ((src_pos->x + src_pos->w > src_sz->hsize) ||
(src_pos->y + src_pos->h > src_sz->vsize)) { (src_pos->y + src_pos->h > src_sz->vsize)) {
DRM_DEBUG_KMS("%s:out of source buffer bound\n", __func__); DRM_DEBUG_KMS("out of source buffer bound\n");
return -EINVAL; return -EINVAL;
} }
if (swap) { if (swap) {
if ((dst_pos->x + dst_pos->h > dst_sz->vsize) || if ((dst_pos->x + dst_pos->h > dst_sz->vsize) ||
(dst_pos->y + dst_pos->w > dst_sz->hsize)) { (dst_pos->y + dst_pos->w > dst_sz->hsize)) {
DRM_DEBUG_KMS("%s:out of destination buffer bound\n", DRM_DEBUG_KMS("out of destination buffer bound\n");
__func__);
return -EINVAL; return -EINVAL;
} }
if ((src_pos->w != dst_pos->h) || (src_pos->h != dst_pos->w)) { if ((src_pos->w != dst_pos->h) || (src_pos->h != dst_pos->w)) {
DRM_DEBUG_KMS("%s:not support scale feature\n", DRM_DEBUG_KMS("not support scale feature\n");
__func__);
return -EINVAL; return -EINVAL;
} }
} else { } else {
if ((dst_pos->x + dst_pos->w > dst_sz->hsize) || if ((dst_pos->x + dst_pos->w > dst_sz->hsize) ||
(dst_pos->y + dst_pos->h > dst_sz->vsize)) { (dst_pos->y + dst_pos->h > dst_sz->vsize)) {
DRM_DEBUG_KMS("%s:out of destination buffer bound\n", DRM_DEBUG_KMS("out of destination buffer bound\n");
__func__);
return -EINVAL; return -EINVAL;
} }
if ((src_pos->w != dst_pos->w) || (src_pos->h != dst_pos->h)) { if ((src_pos->w != dst_pos->w) || (src_pos->h != dst_pos->h)) {
DRM_DEBUG_KMS("%s:not support scale feature\n", DRM_DEBUG_KMS("not support scale feature\n");
__func__);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -693,7 +686,7 @@ static int rotator_probe(struct platform_device *pdev) ...@@ -693,7 +686,7 @@ static int rotator_probe(struct platform_device *pdev)
goto err_ippdrv_register; goto err_ippdrv_register;
} }
DRM_DEBUG_KMS("%s:ippdrv[0x%x]\n", __func__, (int)ippdrv); DRM_DEBUG_KMS("ippdrv[0x%x]\n", (int)ippdrv);
platform_set_drvdata(pdev, rot); platform_set_drvdata(pdev, rot);
...@@ -752,8 +745,6 @@ static struct platform_device_id rotator_driver_ids[] = { ...@@ -752,8 +745,6 @@ static struct platform_device_id rotator_driver_ids[] = {
static int rotator_clk_crtl(struct rot_context *rot, bool enable) static int rotator_clk_crtl(struct rot_context *rot, bool enable)
{ {
DRM_DEBUG_KMS("%s\n", __func__);
if (enable) { if (enable) {
clk_enable(rot->clock); clk_enable(rot->clock);
rot->suspended = false; rot->suspended = false;
...@@ -771,8 +762,6 @@ static int rotator_suspend(struct device *dev) ...@@ -771,8 +762,6 @@ static int rotator_suspend(struct device *dev)
{ {
struct rot_context *rot = dev_get_drvdata(dev); struct rot_context *rot = dev_get_drvdata(dev);
DRM_DEBUG_KMS("%s\n", __func__);
if (pm_runtime_suspended(dev)) if (pm_runtime_suspended(dev))
return 0; return 0;
...@@ -783,8 +772,6 @@ static int rotator_resume(struct device *dev) ...@@ -783,8 +772,6 @@ static int rotator_resume(struct device *dev)
{ {
struct rot_context *rot = dev_get_drvdata(dev); struct rot_context *rot = dev_get_drvdata(dev);
DRM_DEBUG_KMS("%s\n", __func__);
if (!pm_runtime_suspended(dev)) if (!pm_runtime_suspended(dev))
return rotator_clk_crtl(rot, true); return rotator_clk_crtl(rot, true);
...@@ -797,8 +784,6 @@ static int rotator_runtime_suspend(struct device *dev) ...@@ -797,8 +784,6 @@ static int rotator_runtime_suspend(struct device *dev)
{ {
struct rot_context *rot = dev_get_drvdata(dev); struct rot_context *rot = dev_get_drvdata(dev);
DRM_DEBUG_KMS("%s\n", __func__);
return rotator_clk_crtl(rot, false); return rotator_clk_crtl(rot, false);
} }
...@@ -806,8 +791,6 @@ static int rotator_runtime_resume(struct device *dev) ...@@ -806,8 +791,6 @@ static int rotator_runtime_resume(struct device *dev)
{ {
struct rot_context *rot = dev_get_drvdata(dev); struct rot_context *rot = dev_get_drvdata(dev);
DRM_DEBUG_KMS("%s\n", __func__);
return rotator_clk_crtl(rot, true); return rotator_clk_crtl(rot, true);
} }
#endif #endif
......
...@@ -89,8 +89,6 @@ static bool vidi_display_is_connected(struct device *dev) ...@@ -89,8 +89,6 @@ static bool vidi_display_is_connected(struct device *dev)
{ {
struct vidi_context *ctx = get_vidi_context(dev); struct vidi_context *ctx = get_vidi_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* connection request would come from user side * connection request would come from user side
* to do hotplug through specific ioctl. * to do hotplug through specific ioctl.
...@@ -105,8 +103,6 @@ static struct edid *vidi_get_edid(struct device *dev, ...@@ -105,8 +103,6 @@ static struct edid *vidi_get_edid(struct device *dev,
struct edid *edid; struct edid *edid;
int edid_len; int edid_len;
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* the edid data comes from user side and it would be set * the edid data comes from user side and it would be set
* to ctx->raw_edid through specific ioctl. * to ctx->raw_edid through specific ioctl.
...@@ -128,17 +124,13 @@ static struct edid *vidi_get_edid(struct device *dev, ...@@ -128,17 +124,13 @@ static struct edid *vidi_get_edid(struct device *dev,
static void *vidi_get_panel(struct device *dev) static void *vidi_get_panel(struct device *dev)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO. */ /* TODO. */
return NULL; return NULL;
} }
static int vidi_check_timing(struct device *dev, void *timing) static int vidi_check_mode(struct device *dev, struct drm_display_mode *mode)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO. */ /* TODO. */
return 0; return 0;
...@@ -146,8 +138,6 @@ static int vidi_check_timing(struct device *dev, void *timing) ...@@ -146,8 +138,6 @@ static int vidi_check_timing(struct device *dev, void *timing)
static int vidi_display_power_on(struct device *dev, int mode) static int vidi_display_power_on(struct device *dev, int mode)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO */ /* TODO */
return 0; return 0;
...@@ -158,7 +148,7 @@ static struct exynos_drm_display_ops vidi_display_ops = { ...@@ -158,7 +148,7 @@ static struct exynos_drm_display_ops vidi_display_ops = {
.is_connected = vidi_display_is_connected, .is_connected = vidi_display_is_connected,
.get_edid = vidi_get_edid, .get_edid = vidi_get_edid,
.get_panel = vidi_get_panel, .get_panel = vidi_get_panel,
.check_timing = vidi_check_timing, .check_mode = vidi_check_mode,
.power_on = vidi_display_power_on, .power_on = vidi_display_power_on,
}; };
...@@ -166,7 +156,7 @@ static void vidi_dpms(struct device *subdrv_dev, int mode) ...@@ -166,7 +156,7 @@ static void vidi_dpms(struct device *subdrv_dev, int mode)
{ {
struct vidi_context *ctx = get_vidi_context(subdrv_dev); struct vidi_context *ctx = get_vidi_context(subdrv_dev);
DRM_DEBUG_KMS("%s, %d\n", __FILE__, mode); DRM_DEBUG_KMS("%d\n", mode);
mutex_lock(&ctx->lock); mutex_lock(&ctx->lock);
...@@ -196,8 +186,6 @@ static void vidi_apply(struct device *subdrv_dev) ...@@ -196,8 +186,6 @@ static void vidi_apply(struct device *subdrv_dev)
struct vidi_win_data *win_data; struct vidi_win_data *win_data;
int i; int i;
DRM_DEBUG_KMS("%s\n", __FILE__);
for (i = 0; i < WINDOWS_NR; i++) { for (i = 0; i < WINDOWS_NR; i++) {
win_data = &ctx->win_data[i]; win_data = &ctx->win_data[i];
if (win_data->enabled && (ovl_ops && ovl_ops->commit)) if (win_data->enabled && (ovl_ops && ovl_ops->commit))
...@@ -212,8 +200,6 @@ static void vidi_commit(struct device *dev) ...@@ -212,8 +200,6 @@ static void vidi_commit(struct device *dev)
{ {
struct vidi_context *ctx = get_vidi_context(dev); struct vidi_context *ctx = get_vidi_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ctx->suspended) if (ctx->suspended)
return; return;
} }
...@@ -222,8 +208,6 @@ static int vidi_enable_vblank(struct device *dev) ...@@ -222,8 +208,6 @@ static int vidi_enable_vblank(struct device *dev)
{ {
struct vidi_context *ctx = get_vidi_context(dev); struct vidi_context *ctx = get_vidi_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ctx->suspended) if (ctx->suspended)
return -EPERM; return -EPERM;
...@@ -246,8 +230,6 @@ static void vidi_disable_vblank(struct device *dev) ...@@ -246,8 +230,6 @@ static void vidi_disable_vblank(struct device *dev)
{ {
struct vidi_context *ctx = get_vidi_context(dev); struct vidi_context *ctx = get_vidi_context(dev);
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ctx->suspended) if (ctx->suspended)
return; return;
...@@ -271,8 +253,6 @@ static void vidi_win_mode_set(struct device *dev, ...@@ -271,8 +253,6 @@ static void vidi_win_mode_set(struct device *dev,
int win; int win;
unsigned long offset; unsigned long offset;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!overlay) { if (!overlay) {
dev_err(dev, "overlay is NULL\n"); dev_err(dev, "overlay is NULL\n");
return; return;
...@@ -282,7 +262,7 @@ static void vidi_win_mode_set(struct device *dev, ...@@ -282,7 +262,7 @@ static void vidi_win_mode_set(struct device *dev,
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = ctx->default_win; win = ctx->default_win;
if (win < 0 || win > WINDOWS_NR) if (win < 0 || win >= WINDOWS_NR)
return; return;
offset = overlay->fb_x * (overlay->bpp >> 3); offset = overlay->fb_x * (overlay->bpp >> 3);
...@@ -324,15 +304,13 @@ static void vidi_win_commit(struct device *dev, int zpos) ...@@ -324,15 +304,13 @@ static void vidi_win_commit(struct device *dev, int zpos)
struct vidi_win_data *win_data; struct vidi_win_data *win_data;
int win = zpos; int win = zpos;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (ctx->suspended) if (ctx->suspended)
return; return;
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = ctx->default_win; win = ctx->default_win;
if (win < 0 || win > WINDOWS_NR) if (win < 0 || win >= WINDOWS_NR)
return; return;
win_data = &ctx->win_data[win]; win_data = &ctx->win_data[win];
...@@ -351,12 +329,10 @@ static void vidi_win_disable(struct device *dev, int zpos) ...@@ -351,12 +329,10 @@ static void vidi_win_disable(struct device *dev, int zpos)
struct vidi_win_data *win_data; struct vidi_win_data *win_data;
int win = zpos; int win = zpos;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = ctx->default_win; win = ctx->default_win;
if (win < 0 || win > WINDOWS_NR) if (win < 0 || win >= WINDOWS_NR)
return; return;
win_data = &ctx->win_data[win]; win_data = &ctx->win_data[win];
...@@ -407,8 +383,6 @@ static void vidi_fake_vblank_handler(struct work_struct *work) ...@@ -407,8 +383,6 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* /*
* enable drm irq mode. * enable drm irq mode.
* - with irq_enabled = 1, we can use the vblank feature. * - with irq_enabled = 1, we can use the vblank feature.
...@@ -431,8 +405,6 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ...@@ -431,8 +405,6 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
static void vidi_subdrv_remove(struct drm_device *drm_dev, struct device *dev) static void vidi_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__);
/* TODO. */ /* TODO. */
} }
...@@ -441,8 +413,6 @@ static int vidi_power_on(struct vidi_context *ctx, bool enable) ...@@ -441,8 +413,6 @@ static int vidi_power_on(struct vidi_context *ctx, bool enable)
struct exynos_drm_subdrv *subdrv = &ctx->subdrv; struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
struct device *dev = subdrv->dev; struct device *dev = subdrv->dev;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (enable != false && enable != true) if (enable != false && enable != true)
return -EINVAL; return -EINVAL;
...@@ -483,8 +453,6 @@ static int vidi_store_connection(struct device *dev, ...@@ -483,8 +453,6 @@ static int vidi_store_connection(struct device *dev,
struct vidi_context *ctx = get_vidi_context(dev); struct vidi_context *ctx = get_vidi_context(dev);
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
ret = kstrtoint(buf, 0, &ctx->connected); ret = kstrtoint(buf, 0, &ctx->connected);
if (ret) if (ret)
return ret; return ret;
...@@ -522,8 +490,6 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, ...@@ -522,8 +490,6 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
struct drm_exynos_vidi_connection *vidi = data; struct drm_exynos_vidi_connection *vidi = data;
int edid_len; int edid_len;
DRM_DEBUG_KMS("%s\n", __FILE__);
if (!vidi) { if (!vidi) {
DRM_DEBUG_KMS("user data for vidi is null.\n"); DRM_DEBUG_KMS("user data for vidi is null.\n");
return -EINVAL; return -EINVAL;
...@@ -592,8 +558,6 @@ static int vidi_probe(struct platform_device *pdev) ...@@ -592,8 +558,6 @@ static int vidi_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv; struct exynos_drm_subdrv *subdrv;
int ret; int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx) if (!ctx)
return -ENOMEM; return -ENOMEM;
...@@ -625,8 +589,6 @@ static int vidi_remove(struct platform_device *pdev) ...@@ -625,8 +589,6 @@ static int vidi_remove(struct platform_device *pdev)
{ {
struct vidi_context *ctx = platform_get_drvdata(pdev); struct vidi_context *ctx = platform_get_drvdata(pdev);
DRM_DEBUG_KMS("%s\n", __FILE__);
exynos_drm_subdrv_unregister(&ctx->subdrv); exynos_drm_subdrv_unregister(&ctx->subdrv);
if (ctx->raw_edid != (struct edid *)fake_edid_info) { if (ctx->raw_edid != (struct edid *)fake_edid_info) {
......
...@@ -83,6 +83,7 @@ struct hdmi_resources { ...@@ -83,6 +83,7 @@ struct hdmi_resources {
struct clk *sclk_pixel; struct clk *sclk_pixel;
struct clk *sclk_hdmiphy; struct clk *sclk_hdmiphy;
struct clk *hdmiphy; struct clk *hdmiphy;
struct clk *mout_hdmi;
struct regulator_bulk_data *regul_bulk; struct regulator_bulk_data *regul_bulk;
int regul_count; int regul_count;
}; };
...@@ -689,8 +690,6 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata, ...@@ -689,8 +690,6 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
u32 mod; u32 mod;
u32 vic; u32 vic;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mod = hdmi_reg_read(hdata, HDMI_MODE_SEL); mod = hdmi_reg_read(hdata, HDMI_MODE_SEL);
if (hdata->dvi_mode) { if (hdata->dvi_mode) {
hdmi_reg_writeb(hdata, HDMI_VSI_CON, hdmi_reg_writeb(hdata, HDMI_VSI_CON,
...@@ -755,8 +754,6 @@ static struct edid *hdmi_get_edid(void *ctx, struct drm_connector *connector) ...@@ -755,8 +754,6 @@ static struct edid *hdmi_get_edid(void *ctx, struct drm_connector *connector)
struct edid *raw_edid; struct edid *raw_edid;
struct hdmi_context *hdata = ctx; struct hdmi_context *hdata = ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (!hdata->ddc_port) if (!hdata->ddc_port)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
...@@ -777,8 +774,6 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock) ...@@ -777,8 +774,6 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock)
const struct hdmiphy_config *confs; const struct hdmiphy_config *confs;
int count, i; int count, i;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (hdata->type == HDMI_TYPE13) { if (hdata->type == HDMI_TYPE13) {
confs = hdmiphy_v13_configs; confs = hdmiphy_v13_configs;
count = ARRAY_SIZE(hdmiphy_v13_configs); count = ARRAY_SIZE(hdmiphy_v13_configs);
...@@ -796,18 +791,17 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock) ...@@ -796,18 +791,17 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock)
return -EINVAL; return -EINVAL;
} }
static int hdmi_check_timing(void *ctx, struct fb_videomode *timing) static int hdmi_check_mode(void *ctx, struct drm_display_mode *mode)
{ {
struct hdmi_context *hdata = ctx; struct hdmi_context *hdata = ctx;
int ret; int ret;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n",
mode->hdisplay, mode->vdisplay, mode->vrefresh,
DRM_DEBUG_KMS("[%d]x[%d] [%d]Hz [%x]\n", timing->xres, (mode->flags & DRM_MODE_FLAG_INTERLACE) ? true :
timing->yres, timing->refresh, false, mode->clock * 1000);
timing->vmode);
ret = hdmi_find_phy_conf(hdata, timing->pixclock); ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
if (ret < 0) if (ret < 0)
return ret; return ret;
return 0; return 0;
...@@ -1042,7 +1036,7 @@ static void hdmi_conf_init(struct hdmi_context *hdata) ...@@ -1042,7 +1036,7 @@ static void hdmi_conf_init(struct hdmi_context *hdata)
} }
} }
static void hdmi_v13_timing_apply(struct hdmi_context *hdata) static void hdmi_v13_mode_apply(struct hdmi_context *hdata)
{ {
const struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v13_conf.tg; const struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v13_conf.tg;
const struct hdmi_v13_core_regs *core = const struct hdmi_v13_core_regs *core =
...@@ -1118,9 +1112,9 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata) ...@@ -1118,9 +1112,9 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata)
hdmi_regs_dump(hdata, "timing apply"); hdmi_regs_dump(hdata, "timing apply");
} }
clk_disable(hdata->res.sclk_hdmi); clk_disable_unprepare(hdata->res.sclk_hdmi);
clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy); clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
clk_enable(hdata->res.sclk_hdmi); clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */ /* enable HDMI and timing generator */
hdmi_reg_writemask(hdata, HDMI_CON_0, ~0, HDMI_EN); hdmi_reg_writemask(hdata, HDMI_CON_0, ~0, HDMI_EN);
...@@ -1131,7 +1125,7 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata) ...@@ -1131,7 +1125,7 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata)
hdmi_reg_writemask(hdata, HDMI_TG_CMD, ~0, HDMI_TG_EN); hdmi_reg_writemask(hdata, HDMI_TG_CMD, ~0, HDMI_TG_EN);
} }
static void hdmi_v14_timing_apply(struct hdmi_context *hdata) static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
{ {
const struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v14_conf.tg; const struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v14_conf.tg;
const struct hdmi_v14_core_regs *core = const struct hdmi_v14_core_regs *core =
...@@ -1285,9 +1279,9 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata) ...@@ -1285,9 +1279,9 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata)
hdmi_regs_dump(hdata, "timing apply"); hdmi_regs_dump(hdata, "timing apply");
} }
clk_disable(hdata->res.sclk_hdmi); clk_disable_unprepare(hdata->res.sclk_hdmi);
clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy); clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
clk_enable(hdata->res.sclk_hdmi); clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */ /* enable HDMI and timing generator */
hdmi_reg_writemask(hdata, HDMI_CON_0, ~0, HDMI_EN); hdmi_reg_writemask(hdata, HDMI_CON_0, ~0, HDMI_EN);
...@@ -1298,12 +1292,12 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata) ...@@ -1298,12 +1292,12 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata)
hdmi_reg_writemask(hdata, HDMI_TG_CMD, ~0, HDMI_TG_EN); hdmi_reg_writemask(hdata, HDMI_TG_CMD, ~0, HDMI_TG_EN);
} }
static void hdmi_timing_apply(struct hdmi_context *hdata) static void hdmi_mode_apply(struct hdmi_context *hdata)
{ {
if (hdata->type == HDMI_TYPE13) if (hdata->type == HDMI_TYPE13)
hdmi_v13_timing_apply(hdata); hdmi_v13_mode_apply(hdata);
else else
hdmi_v14_timing_apply(hdata); hdmi_v14_mode_apply(hdata);
} }
static void hdmiphy_conf_reset(struct hdmi_context *hdata) static void hdmiphy_conf_reset(struct hdmi_context *hdata)
...@@ -1311,9 +1305,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata) ...@@ -1311,9 +1305,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
u8 buffer[2]; u8 buffer[2];
u32 reg; u32 reg;
clk_disable(hdata->res.sclk_hdmi); clk_disable_unprepare(hdata->res.sclk_hdmi);
clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_pixel); clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
clk_enable(hdata->res.sclk_hdmi); clk_prepare_enable(hdata->res.sclk_hdmi);
/* operation mode */ /* operation mode */
buffer[0] = 0x1f; buffer[0] = 0x1f;
...@@ -1336,8 +1330,6 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata) ...@@ -1336,8 +1330,6 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
static void hdmiphy_poweron(struct hdmi_context *hdata) static void hdmiphy_poweron(struct hdmi_context *hdata)
{ {
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (hdata->type == HDMI_TYPE14) if (hdata->type == HDMI_TYPE14)
hdmi_reg_writemask(hdata, HDMI_PHY_CON_0, 0, hdmi_reg_writemask(hdata, HDMI_PHY_CON_0, 0,
HDMI_PHY_POWER_OFF_EN); HDMI_PHY_POWER_OFF_EN);
...@@ -1345,8 +1337,6 @@ static void hdmiphy_poweron(struct hdmi_context *hdata) ...@@ -1345,8 +1337,6 @@ static void hdmiphy_poweron(struct hdmi_context *hdata)
static void hdmiphy_poweroff(struct hdmi_context *hdata) static void hdmiphy_poweroff(struct hdmi_context *hdata)
{ {
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (hdata->type == HDMI_TYPE14) if (hdata->type == HDMI_TYPE14)
hdmi_reg_writemask(hdata, HDMI_PHY_CON_0, ~0, hdmi_reg_writemask(hdata, HDMI_PHY_CON_0, ~0,
HDMI_PHY_POWER_OFF_EN); HDMI_PHY_POWER_OFF_EN);
...@@ -1410,8 +1400,6 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata) ...@@ -1410,8 +1400,6 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata)
static void hdmi_conf_apply(struct hdmi_context *hdata) static void hdmi_conf_apply(struct hdmi_context *hdata)
{ {
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
hdmiphy_conf_reset(hdata); hdmiphy_conf_reset(hdata);
hdmiphy_conf_apply(hdata); hdmiphy_conf_apply(hdata);
...@@ -1423,7 +1411,7 @@ static void hdmi_conf_apply(struct hdmi_context *hdata) ...@@ -1423,7 +1411,7 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)
hdmi_audio_init(hdata); hdmi_audio_init(hdata);
/* setting core registers */ /* setting core registers */
hdmi_timing_apply(hdata); hdmi_mode_apply(hdata);
hdmi_audio_control(hdata, true); hdmi_audio_control(hdata, true);
hdmi_regs_dump(hdata, "start"); hdmi_regs_dump(hdata, "start");
...@@ -1569,8 +1557,7 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata, ...@@ -1569,8 +1557,7 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
(m->vsync_start - m->vdisplay) / 2); (m->vsync_start - m->vdisplay) / 2);
hdmi_set_reg(core->v2_blank, 2, m->vtotal / 2); hdmi_set_reg(core->v2_blank, 2, m->vtotal / 2);
hdmi_set_reg(core->v1_blank, 2, (m->vtotal - m->vdisplay) / 2); hdmi_set_reg(core->v1_blank, 2, (m->vtotal - m->vdisplay) / 2);
hdmi_set_reg(core->v_blank_f0, 2, (m->vtotal + hdmi_set_reg(core->v_blank_f0, 2, m->vtotal - m->vdisplay / 2);
((m->vsync_end - m->vsync_start) * 4) + 5) / 2);
hdmi_set_reg(core->v_blank_f1, 2, m->vtotal); hdmi_set_reg(core->v_blank_f1, 2, m->vtotal);
hdmi_set_reg(core->v_sync_line_aft_2, 2, (m->vtotal / 2) + 7); hdmi_set_reg(core->v_sync_line_aft_2, 2, (m->vtotal / 2) + 7);
hdmi_set_reg(core->v_sync_line_aft_1, 2, (m->vtotal / 2) + 2); hdmi_set_reg(core->v_sync_line_aft_1, 2, (m->vtotal / 2) + 2);
...@@ -1580,7 +1567,10 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata, ...@@ -1580,7 +1567,10 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
(m->htotal / 2) + (m->hsync_start - m->hdisplay)); (m->htotal / 2) + (m->hsync_start - m->hdisplay));
hdmi_set_reg(tg->vact_st, 2, (m->vtotal - m->vdisplay) / 2); hdmi_set_reg(tg->vact_st, 2, (m->vtotal - m->vdisplay) / 2);
hdmi_set_reg(tg->vact_sz, 2, m->vdisplay / 2); hdmi_set_reg(tg->vact_sz, 2, m->vdisplay / 2);
hdmi_set_reg(tg->vact_st2, 2, 0x249);/* Reset value + 1*/ hdmi_set_reg(tg->vact_st2, 2, m->vtotal - m->vdisplay / 2);
hdmi_set_reg(tg->vsync2, 2, (m->vtotal / 2) + 1);
hdmi_set_reg(tg->vsync_bot_hdmi, 2, (m->vtotal / 2) + 1);
hdmi_set_reg(tg->field_bot_hdmi, 2, (m->vtotal / 2) + 1);
hdmi_set_reg(tg->vact_st3, 2, 0x0); hdmi_set_reg(tg->vact_st3, 2, 0x0);
hdmi_set_reg(tg->vact_st4, 2, 0x0); hdmi_set_reg(tg->vact_st4, 2, 0x0);
} else { } else {
...@@ -1602,6 +1592,9 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata, ...@@ -1602,6 +1592,9 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
hdmi_set_reg(tg->vact_st2, 2, 0x248); /* Reset value */ hdmi_set_reg(tg->vact_st2, 2, 0x248); /* Reset value */
hdmi_set_reg(tg->vact_st3, 2, 0x47b); /* Reset value */ hdmi_set_reg(tg->vact_st3, 2, 0x47b); /* Reset value */
hdmi_set_reg(tg->vact_st4, 2, 0x6ae); /* Reset value */ hdmi_set_reg(tg->vact_st4, 2, 0x6ae); /* Reset value */
hdmi_set_reg(tg->vsync2, 2, 0x233); /* Reset value */
hdmi_set_reg(tg->vsync_bot_hdmi, 2, 0x233); /* Reset value */
hdmi_set_reg(tg->field_bot_hdmi, 2, 0x233); /* Reset value */
} }
/* Following values & calculations are same irrespective of mode type */ /* Following values & calculations are same irrespective of mode type */
...@@ -1633,22 +1626,19 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata, ...@@ -1633,22 +1626,19 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
hdmi_set_reg(tg->hact_sz, 2, m->hdisplay); hdmi_set_reg(tg->hact_sz, 2, m->hdisplay);
hdmi_set_reg(tg->v_fsz, 2, m->vtotal); hdmi_set_reg(tg->v_fsz, 2, m->vtotal);
hdmi_set_reg(tg->vsync, 2, 0x1); hdmi_set_reg(tg->vsync, 2, 0x1);
hdmi_set_reg(tg->vsync2, 2, 0x233); /* Reset value */
hdmi_set_reg(tg->field_chg, 2, 0x233); /* Reset value */ hdmi_set_reg(tg->field_chg, 2, 0x233); /* Reset value */
hdmi_set_reg(tg->vsync_top_hdmi, 2, 0x1); /* Reset value */ hdmi_set_reg(tg->vsync_top_hdmi, 2, 0x1); /* Reset value */
hdmi_set_reg(tg->vsync_bot_hdmi, 2, 0x233); /* Reset value */
hdmi_set_reg(tg->field_top_hdmi, 2, 0x1); /* Reset value */ hdmi_set_reg(tg->field_top_hdmi, 2, 0x1); /* Reset value */
hdmi_set_reg(tg->field_bot_hdmi, 2, 0x233); /* Reset value */
hdmi_set_reg(tg->tg_3d, 1, 0x0); hdmi_set_reg(tg->tg_3d, 1, 0x0);
} }
static void hdmi_mode_set(void *ctx, void *mode) static void hdmi_mode_set(void *ctx, struct drm_display_mode *mode)
{ {
struct hdmi_context *hdata = ctx; struct hdmi_context *hdata = ctx;
struct drm_display_mode *m = mode; struct drm_display_mode *m = mode;
DRM_DEBUG_KMS("[%s]: xres=%d, yres=%d, refresh=%d, intl=%s\n", DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%s\n",
__func__, m->hdisplay, m->vdisplay, m->hdisplay, m->vdisplay,
m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ? m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ?
"INTERLACED" : "PROGERESSIVE"); "INTERLACED" : "PROGERESSIVE");
...@@ -1661,8 +1651,6 @@ static void hdmi_mode_set(void *ctx, void *mode) ...@@ -1661,8 +1651,6 @@ static void hdmi_mode_set(void *ctx, void *mode)
static void hdmi_get_max_resol(void *ctx, unsigned int *width, static void hdmi_get_max_resol(void *ctx, unsigned int *width,
unsigned int *height) unsigned int *height)
{ {
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
*width = MAX_WIDTH; *width = MAX_WIDTH;
*height = MAX_HEIGHT; *height = MAX_HEIGHT;
} }
...@@ -1671,8 +1659,6 @@ static void hdmi_commit(void *ctx) ...@@ -1671,8 +1659,6 @@ static void hdmi_commit(void *ctx)
{ {
struct hdmi_context *hdata = ctx; struct hdmi_context *hdata = ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mutex_lock(&hdata->hdmi_mutex); mutex_lock(&hdata->hdmi_mutex);
if (!hdata->powered) { if (!hdata->powered) {
mutex_unlock(&hdata->hdmi_mutex); mutex_unlock(&hdata->hdmi_mutex);
...@@ -1687,8 +1673,6 @@ static void hdmi_poweron(struct hdmi_context *hdata) ...@@ -1687,8 +1673,6 @@ static void hdmi_poweron(struct hdmi_context *hdata)
{ {
struct hdmi_resources *res = &hdata->res; struct hdmi_resources *res = &hdata->res;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mutex_lock(&hdata->hdmi_mutex); mutex_lock(&hdata->hdmi_mutex);
if (hdata->powered) { if (hdata->powered) {
mutex_unlock(&hdata->hdmi_mutex); mutex_unlock(&hdata->hdmi_mutex);
...@@ -1699,10 +1683,12 @@ static void hdmi_poweron(struct hdmi_context *hdata) ...@@ -1699,10 +1683,12 @@ static void hdmi_poweron(struct hdmi_context *hdata)
mutex_unlock(&hdata->hdmi_mutex); mutex_unlock(&hdata->hdmi_mutex);
regulator_bulk_enable(res->regul_count, res->regul_bulk); if (regulator_bulk_enable(res->regul_count, res->regul_bulk))
clk_enable(res->hdmiphy); DRM_DEBUG_KMS("failed to enable regulator bulk\n");
clk_enable(res->hdmi);
clk_enable(res->sclk_hdmi); clk_prepare_enable(res->hdmiphy);
clk_prepare_enable(res->hdmi);
clk_prepare_enable(res->sclk_hdmi);
hdmiphy_poweron(hdata); hdmiphy_poweron(hdata);
} }
...@@ -1711,8 +1697,6 @@ static void hdmi_poweroff(struct hdmi_context *hdata) ...@@ -1711,8 +1697,6 @@ static void hdmi_poweroff(struct hdmi_context *hdata)
{ {
struct hdmi_resources *res = &hdata->res; struct hdmi_resources *res = &hdata->res;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mutex_lock(&hdata->hdmi_mutex); mutex_lock(&hdata->hdmi_mutex);
if (!hdata->powered) if (!hdata->powered)
goto out; goto out;
...@@ -1725,9 +1709,9 @@ static void hdmi_poweroff(struct hdmi_context *hdata) ...@@ -1725,9 +1709,9 @@ static void hdmi_poweroff(struct hdmi_context *hdata)
hdmiphy_conf_reset(hdata); hdmiphy_conf_reset(hdata);
hdmiphy_poweroff(hdata); hdmiphy_poweroff(hdata);
clk_disable(res->sclk_hdmi); clk_disable_unprepare(res->sclk_hdmi);
clk_disable(res->hdmi); clk_disable_unprepare(res->hdmi);
clk_disable(res->hdmiphy); clk_disable_unprepare(res->hdmiphy);
regulator_bulk_disable(res->regul_count, res->regul_bulk); regulator_bulk_disable(res->regul_count, res->regul_bulk);
mutex_lock(&hdata->hdmi_mutex); mutex_lock(&hdata->hdmi_mutex);
...@@ -1742,7 +1726,7 @@ static void hdmi_dpms(void *ctx, int mode) ...@@ -1742,7 +1726,7 @@ static void hdmi_dpms(void *ctx, int mode)
{ {
struct hdmi_context *hdata = ctx; struct hdmi_context *hdata = ctx;
DRM_DEBUG_KMS("[%d] %s mode %d\n", __LINE__, __func__, mode); DRM_DEBUG_KMS("mode %d\n", mode);
switch (mode) { switch (mode) {
case DRM_MODE_DPMS_ON: case DRM_MODE_DPMS_ON:
...@@ -1765,7 +1749,7 @@ static struct exynos_hdmi_ops hdmi_ops = { ...@@ -1765,7 +1749,7 @@ static struct exynos_hdmi_ops hdmi_ops = {
/* display */ /* display */
.is_connected = hdmi_is_connected, .is_connected = hdmi_is_connected,
.get_edid = hdmi_get_edid, .get_edid = hdmi_get_edid,
.check_timing = hdmi_check_timing, .check_mode = hdmi_check_mode,
/* manager */ /* manager */
.mode_set = hdmi_mode_set, .mode_set = hdmi_mode_set,
...@@ -1831,8 +1815,13 @@ static int hdmi_resources_init(struct hdmi_context *hdata) ...@@ -1831,8 +1815,13 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
DRM_ERROR("failed to get clock 'hdmiphy'\n"); DRM_ERROR("failed to get clock 'hdmiphy'\n");
goto fail; goto fail;
} }
res->mout_hdmi = devm_clk_get(dev, "mout_hdmi");
if (IS_ERR(res->mout_hdmi)) {
DRM_ERROR("failed to get clock 'mout_hdmi'\n");
goto fail;
}
clk_set_parent(res->sclk_hdmi, res->sclk_pixel); clk_set_parent(res->mout_hdmi, res->sclk_pixel);
res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) * res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) *
sizeof(res->regul_bulk[0]), GFP_KERNEL); sizeof(res->regul_bulk[0]), GFP_KERNEL);
...@@ -1877,7 +1866,6 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata ...@@ -1877,7 +1866,6 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
{ {
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct s5p_hdmi_platform_data *pd; struct s5p_hdmi_platform_data *pd;
enum of_gpio_flags flags;
u32 value; u32 value;
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
...@@ -1891,7 +1879,7 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata ...@@ -1891,7 +1879,7 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
goto err_data; goto err_data;
} }
pd->hpd_gpio = of_get_named_gpio_flags(np, "hpd-gpio", 0, &flags); pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
return pd; return pd;
...@@ -1929,6 +1917,9 @@ static struct of_device_id hdmi_match_types[] = { ...@@ -1929,6 +1917,9 @@ static struct of_device_id hdmi_match_types[] = {
{ {
.compatible = "samsung,exynos5-hdmi", .compatible = "samsung,exynos5-hdmi",
.data = (void *)HDMI_TYPE14, .data = (void *)HDMI_TYPE14,
}, {
.compatible = "samsung,exynos4212-hdmi",
.data = (void *)HDMI_TYPE14,
}, { }, {
/* end node */ /* end node */
} }
...@@ -1944,8 +1935,6 @@ static int hdmi_probe(struct platform_device *pdev) ...@@ -1944,8 +1935,6 @@ static int hdmi_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int ret; int ret;
DRM_DEBUG_KMS("[%d]\n", __LINE__);
if (dev->of_node) { if (dev->of_node) {
pdata = drm_hdmi_dt_parse_pdata(dev); pdata = drm_hdmi_dt_parse_pdata(dev);
if (IS_ERR(pdata)) { if (IS_ERR(pdata)) {
...@@ -2071,8 +2060,6 @@ static int hdmi_remove(struct platform_device *pdev) ...@@ -2071,8 +2060,6 @@ static int hdmi_remove(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
pm_runtime_disable(dev); pm_runtime_disable(dev);
/* hdmiphy i2c driver */ /* hdmiphy i2c driver */
...@@ -2089,8 +2076,6 @@ static int hdmi_suspend(struct device *dev) ...@@ -2089,8 +2076,6 @@ static int hdmi_suspend(struct device *dev)
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev); struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
struct hdmi_context *hdata = ctx->ctx; struct hdmi_context *hdata = ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
disable_irq(hdata->irq); disable_irq(hdata->irq);
hdata->hpd = false; hdata->hpd = false;
...@@ -2098,7 +2083,7 @@ static int hdmi_suspend(struct device *dev) ...@@ -2098,7 +2083,7 @@ static int hdmi_suspend(struct device *dev)
drm_helper_hpd_irq_event(ctx->drm_dev); drm_helper_hpd_irq_event(ctx->drm_dev);
if (pm_runtime_suspended(dev)) { if (pm_runtime_suspended(dev)) {
DRM_DEBUG_KMS("%s : Already suspended\n", __func__); DRM_DEBUG_KMS("Already suspended\n");
return 0; return 0;
} }
...@@ -2112,14 +2097,12 @@ static int hdmi_resume(struct device *dev) ...@@ -2112,14 +2097,12 @@ static int hdmi_resume(struct device *dev)
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev); struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
struct hdmi_context *hdata = ctx->ctx; struct hdmi_context *hdata = ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
hdata->hpd = gpio_get_value(hdata->hpd_gpio); hdata->hpd = gpio_get_value(hdata->hpd_gpio);
enable_irq(hdata->irq); enable_irq(hdata->irq);
if (!pm_runtime_suspended(dev)) { if (!pm_runtime_suspended(dev)) {
DRM_DEBUG_KMS("%s : Already resumed\n", __func__); DRM_DEBUG_KMS("Already resumed\n");
return 0; return 0;
} }
...@@ -2134,7 +2117,6 @@ static int hdmi_runtime_suspend(struct device *dev) ...@@ -2134,7 +2117,6 @@ static int hdmi_runtime_suspend(struct device *dev)
{ {
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev); struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
struct hdmi_context *hdata = ctx->ctx; struct hdmi_context *hdata = ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
hdmi_poweroff(hdata); hdmi_poweroff(hdata);
...@@ -2145,7 +2127,6 @@ static int hdmi_runtime_resume(struct device *dev) ...@@ -2145,7 +2127,6 @@ static int hdmi_runtime_resume(struct device *dev)
{ {
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev); struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
struct hdmi_context *hdata = ctx->ctx; struct hdmi_context *hdata = ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
hdmi_poweron(hdata); hdmi_poweron(hdata);
......
...@@ -50,6 +50,10 @@ static const struct i2c_device_id hdmiphy_id[] = { ...@@ -50,6 +50,10 @@ static const struct i2c_device_id hdmiphy_id[] = {
static struct of_device_id hdmiphy_match_types[] = { static struct of_device_id hdmiphy_match_types[] = {
{ {
.compatible = "samsung,exynos5-hdmiphy", .compatible = "samsung,exynos5-hdmiphy",
}, {
.compatible = "samsung,exynos4210-hdmiphy",
}, {
.compatible = "samsung,exynos4212-hdmiphy",
}, { }, {
/* end node */ /* end node */
} }
......
...@@ -78,6 +78,7 @@ struct mixer_resources { ...@@ -78,6 +78,7 @@ struct mixer_resources {
enum mixer_version_id { enum mixer_version_id {
MXR_VER_0_0_0_16, MXR_VER_0_0_0_16,
MXR_VER_16_0_33_0, MXR_VER_16_0_33_0,
MXR_VER_128_0_0_184,
}; };
struct mixer_context { struct mixer_context {
...@@ -283,7 +284,8 @@ static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height) ...@@ -283,7 +284,8 @@ static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height)
val = (ctx->interlace ? MXR_CFG_SCAN_INTERLACE : val = (ctx->interlace ? MXR_CFG_SCAN_INTERLACE :
MXR_CFG_SCAN_PROGRASSIVE); MXR_CFG_SCAN_PROGRASSIVE);
/* choosing between porper HD and SD mode */ if (ctx->mxr_ver != MXR_VER_128_0_0_184) {
/* choosing between proper HD and SD mode */
if (height <= 480) if (height <= 480)
val |= MXR_CFG_SCAN_NTSC | MXR_CFG_SCAN_SD; val |= MXR_CFG_SCAN_NTSC | MXR_CFG_SCAN_SD;
else if (height <= 576) else if (height <= 576)
...@@ -294,6 +296,7 @@ static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height) ...@@ -294,6 +296,7 @@ static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height)
val |= MXR_CFG_SCAN_HD_1080 | MXR_CFG_SCAN_HD; val |= MXR_CFG_SCAN_HD_1080 | MXR_CFG_SCAN_HD;
else else
val |= MXR_CFG_SCAN_HD_720 | MXR_CFG_SCAN_HD; val |= MXR_CFG_SCAN_HD_720 | MXR_CFG_SCAN_HD;
}
mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_SCAN_MASK); mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_SCAN_MASK);
} }
...@@ -557,6 +560,14 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win) ...@@ -557,6 +560,14 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
/* setup geometry */ /* setup geometry */
mixer_reg_write(res, MXR_GRAPHIC_SPAN(win), win_data->fb_width); mixer_reg_write(res, MXR_GRAPHIC_SPAN(win), win_data->fb_width);
/* setup display size */
if (ctx->mxr_ver == MXR_VER_128_0_0_184 &&
win == MIXER_DEFAULT_WIN) {
val = MXR_MXR_RES_HEIGHT(win_data->fb_height);
val |= MXR_MXR_RES_WIDTH(win_data->fb_width);
mixer_reg_write(res, MXR_RESOLUTION, val);
}
val = MXR_GRP_WH_WIDTH(win_data->crtc_width); val = MXR_GRP_WH_WIDTH(win_data->crtc_width);
val |= MXR_GRP_WH_HEIGHT(win_data->crtc_height); val |= MXR_GRP_WH_HEIGHT(win_data->crtc_height);
val |= MXR_GRP_WH_H_SCALE(x_ratio); val |= MXR_GRP_WH_H_SCALE(x_ratio);
...@@ -581,7 +592,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win) ...@@ -581,7 +592,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
mixer_cfg_layer(ctx, win, true); mixer_cfg_layer(ctx, win, true);
/* layer update mandatory for mixer 16.0.33.0 */ /* layer update mandatory for mixer 16.0.33.0 */
if (ctx->mxr_ver == MXR_VER_16_0_33_0) if (ctx->mxr_ver == MXR_VER_16_0_33_0 ||
ctx->mxr_ver == MXR_VER_128_0_0_184)
mixer_layer_update(ctx); mixer_layer_update(ctx);
mixer_run(ctx); mixer_run(ctx);
...@@ -696,8 +708,6 @@ static int mixer_enable_vblank(void *ctx, int pipe) ...@@ -696,8 +708,6 @@ static int mixer_enable_vblank(void *ctx, int pipe)
struct mixer_context *mixer_ctx = ctx; struct mixer_context *mixer_ctx = ctx;
struct mixer_resources *res = &mixer_ctx->mixer_res; struct mixer_resources *res = &mixer_ctx->mixer_res;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mixer_ctx->pipe = pipe; mixer_ctx->pipe = pipe;
/* enable vsync interrupt */ /* enable vsync interrupt */
...@@ -712,8 +722,6 @@ static void mixer_disable_vblank(void *ctx) ...@@ -712,8 +722,6 @@ static void mixer_disable_vblank(void *ctx)
struct mixer_context *mixer_ctx = ctx; struct mixer_context *mixer_ctx = ctx;
struct mixer_resources *res = &mixer_ctx->mixer_res; struct mixer_resources *res = &mixer_ctx->mixer_res;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
/* disable vsync interrupt */ /* disable vsync interrupt */
mixer_reg_writemask(res, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); mixer_reg_writemask(res, MXR_INT_EN, 0, MXR_INT_EN_VSYNC);
} }
...@@ -725,8 +733,6 @@ static void mixer_win_mode_set(void *ctx, ...@@ -725,8 +733,6 @@ static void mixer_win_mode_set(void *ctx,
struct hdmi_win_data *win_data; struct hdmi_win_data *win_data;
int win; int win;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (!overlay) { if (!overlay) {
DRM_ERROR("overlay is NULL\n"); DRM_ERROR("overlay is NULL\n");
return; return;
...@@ -742,7 +748,7 @@ static void mixer_win_mode_set(void *ctx, ...@@ -742,7 +748,7 @@ static void mixer_win_mode_set(void *ctx,
if (win == DEFAULT_ZPOS) if (win == DEFAULT_ZPOS)
win = MIXER_DEFAULT_WIN; win = MIXER_DEFAULT_WIN;
if (win < 0 || win > MIXER_WIN_NR) { if (win < 0 || win >= MIXER_WIN_NR) {
DRM_ERROR("mixer window[%d] is wrong\n", win); DRM_ERROR("mixer window[%d] is wrong\n", win);
return; return;
} }
...@@ -776,7 +782,7 @@ static void mixer_win_commit(void *ctx, int win) ...@@ -776,7 +782,7 @@ static void mixer_win_commit(void *ctx, int win)
{ {
struct mixer_context *mixer_ctx = ctx; struct mixer_context *mixer_ctx = ctx;
DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win); DRM_DEBUG_KMS("win: %d\n", win);
mutex_lock(&mixer_ctx->mixer_mutex); mutex_lock(&mixer_ctx->mixer_mutex);
if (!mixer_ctx->powered) { if (!mixer_ctx->powered) {
...@@ -799,7 +805,7 @@ static void mixer_win_disable(void *ctx, int win) ...@@ -799,7 +805,7 @@ static void mixer_win_disable(void *ctx, int win)
struct mixer_resources *res = &mixer_ctx->mixer_res; struct mixer_resources *res = &mixer_ctx->mixer_res;
unsigned long flags; unsigned long flags;
DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win); DRM_DEBUG_KMS("win: %d\n", win);
mutex_lock(&mixer_ctx->mixer_mutex); mutex_lock(&mixer_ctx->mixer_mutex);
if (!mixer_ctx->powered) { if (!mixer_ctx->powered) {
...@@ -820,17 +826,21 @@ static void mixer_win_disable(void *ctx, int win) ...@@ -820,17 +826,21 @@ static void mixer_win_disable(void *ctx, int win)
mixer_ctx->win_data[win].enabled = false; mixer_ctx->win_data[win].enabled = false;
} }
static int mixer_check_timing(void *ctx, struct fb_videomode *timing) static int mixer_check_mode(void *ctx, struct drm_display_mode *mode)
{ {
struct mixer_context *mixer_ctx = ctx;
u32 w, h; u32 w, h;
w = timing->xres; w = mode->hdisplay;
h = timing->yres; h = mode->vdisplay;
DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%d\n",
mode->hdisplay, mode->vdisplay, mode->vrefresh,
(mode->flags & DRM_MODE_FLAG_INTERLACE) ? 1 : 0);
DRM_DEBUG_KMS("%s : xres=%d, yres=%d, refresh=%d, intl=%d\n", if (mixer_ctx->mxr_ver == MXR_VER_0_0_0_16 ||
__func__, timing->xres, timing->yres, mixer_ctx->mxr_ver == MXR_VER_128_0_0_184)
timing->refresh, (timing->vmode & return 0;
FB_VMODE_INTERLACED) ? true : false);
if ((w >= 464 && w <= 720 && h >= 261 && h <= 576) || if ((w >= 464 && w <= 720 && h >= 261 && h <= 576) ||
(w >= 1024 && w <= 1280 && h >= 576 && h <= 720) || (w >= 1024 && w <= 1280 && h >= 576 && h <= 720) ||
...@@ -891,8 +901,6 @@ static void mixer_poweron(struct mixer_context *ctx) ...@@ -891,8 +901,6 @@ static void mixer_poweron(struct mixer_context *ctx)
{ {
struct mixer_resources *res = &ctx->mixer_res; struct mixer_resources *res = &ctx->mixer_res;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mutex_lock(&ctx->mixer_mutex); mutex_lock(&ctx->mixer_mutex);
if (ctx->powered) { if (ctx->powered) {
mutex_unlock(&ctx->mixer_mutex); mutex_unlock(&ctx->mixer_mutex);
...@@ -901,10 +909,10 @@ static void mixer_poweron(struct mixer_context *ctx) ...@@ -901,10 +909,10 @@ static void mixer_poweron(struct mixer_context *ctx)
ctx->powered = true; ctx->powered = true;
mutex_unlock(&ctx->mixer_mutex); mutex_unlock(&ctx->mixer_mutex);
clk_enable(res->mixer); clk_prepare_enable(res->mixer);
if (ctx->vp_enabled) { if (ctx->vp_enabled) {
clk_enable(res->vp); clk_prepare_enable(res->vp);
clk_enable(res->sclk_mixer); clk_prepare_enable(res->sclk_mixer);
} }
mixer_reg_write(res, MXR_INT_EN, ctx->int_en); mixer_reg_write(res, MXR_INT_EN, ctx->int_en);
...@@ -917,8 +925,6 @@ static void mixer_poweroff(struct mixer_context *ctx) ...@@ -917,8 +925,6 @@ static void mixer_poweroff(struct mixer_context *ctx)
{ {
struct mixer_resources *res = &ctx->mixer_res; struct mixer_resources *res = &ctx->mixer_res;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mutex_lock(&ctx->mixer_mutex); mutex_lock(&ctx->mixer_mutex);
if (!ctx->powered) if (!ctx->powered)
goto out; goto out;
...@@ -928,10 +934,10 @@ static void mixer_poweroff(struct mixer_context *ctx) ...@@ -928,10 +934,10 @@ static void mixer_poweroff(struct mixer_context *ctx)
ctx->int_en = mixer_reg_read(res, MXR_INT_EN); ctx->int_en = mixer_reg_read(res, MXR_INT_EN);
clk_disable(res->mixer); clk_disable_unprepare(res->mixer);
if (ctx->vp_enabled) { if (ctx->vp_enabled) {
clk_disable(res->vp); clk_disable_unprepare(res->vp);
clk_disable(res->sclk_mixer); clk_disable_unprepare(res->sclk_mixer);
} }
mutex_lock(&ctx->mixer_mutex); mutex_lock(&ctx->mixer_mutex);
...@@ -945,8 +951,6 @@ static void mixer_dpms(void *ctx, int mode) ...@@ -945,8 +951,6 @@ static void mixer_dpms(void *ctx, int mode)
{ {
struct mixer_context *mixer_ctx = ctx; struct mixer_context *mixer_ctx = ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
switch (mode) { switch (mode) {
case DRM_MODE_DPMS_ON: case DRM_MODE_DPMS_ON:
if (pm_runtime_suspended(mixer_ctx->dev)) if (pm_runtime_suspended(mixer_ctx->dev))
...@@ -978,7 +982,7 @@ static struct exynos_mixer_ops mixer_ops = { ...@@ -978,7 +982,7 @@ static struct exynos_mixer_ops mixer_ops = {
.win_disable = mixer_win_disable, .win_disable = mixer_win_disable,
/* display */ /* display */
.check_timing = mixer_check_timing, .check_mode = mixer_check_mode,
}; };
static irqreturn_t mixer_irq_handler(int irq, void *arg) static irqreturn_t mixer_irq_handler(int irq, void *arg)
...@@ -1128,12 +1132,17 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx, ...@@ -1128,12 +1132,17 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx,
return 0; return 0;
} }
static struct mixer_drv_data exynos5_mxr_drv_data = { static struct mixer_drv_data exynos5420_mxr_drv_data = {
.version = MXR_VER_128_0_0_184,
.is_vp_enabled = 0,
};
static struct mixer_drv_data exynos5250_mxr_drv_data = {
.version = MXR_VER_16_0_33_0, .version = MXR_VER_16_0_33_0,
.is_vp_enabled = 0, .is_vp_enabled = 0,
}; };
static struct mixer_drv_data exynos4_mxr_drv_data = { static struct mixer_drv_data exynos4210_mxr_drv_data = {
.version = MXR_VER_0_0_0_16, .version = MXR_VER_0_0_0_16,
.is_vp_enabled = 1, .is_vp_enabled = 1,
}; };
...@@ -1141,10 +1150,10 @@ static struct mixer_drv_data exynos4_mxr_drv_data = { ...@@ -1141,10 +1150,10 @@ static struct mixer_drv_data exynos4_mxr_drv_data = {
static struct platform_device_id mixer_driver_types[] = { static struct platform_device_id mixer_driver_types[] = {
{ {
.name = "s5p-mixer", .name = "s5p-mixer",
.driver_data = (unsigned long)&exynos4_mxr_drv_data, .driver_data = (unsigned long)&exynos4210_mxr_drv_data,
}, { }, {
.name = "exynos5-mixer", .name = "exynos5-mixer",
.driver_data = (unsigned long)&exynos5_mxr_drv_data, .driver_data = (unsigned long)&exynos5250_mxr_drv_data,
}, { }, {
/* end node */ /* end node */
} }
...@@ -1153,7 +1162,13 @@ static struct platform_device_id mixer_driver_types[] = { ...@@ -1153,7 +1162,13 @@ static struct platform_device_id mixer_driver_types[] = {
static struct of_device_id mixer_match_types[] = { static struct of_device_id mixer_match_types[] = {
{ {
.compatible = "samsung,exynos5-mixer", .compatible = "samsung,exynos5-mixer",
.data = &exynos5_mxr_drv_data, .data = &exynos5250_mxr_drv_data,
}, {
.compatible = "samsung,exynos5250-mixer",
.data = &exynos5250_mxr_drv_data,
}, {
.compatible = "samsung,exynos5420-mixer",
.data = &exynos5420_mxr_drv_data,
}, { }, {
/* end node */ /* end node */
} }
...@@ -1186,8 +1201,7 @@ static int mixer_probe(struct platform_device *pdev) ...@@ -1186,8 +1201,7 @@ static int mixer_probe(struct platform_device *pdev)
if (dev->of_node) { if (dev->of_node) {
const struct of_device_id *match; const struct of_device_id *match;
match = of_match_node(of_match_ptr(mixer_match_types), match = of_match_node(mixer_match_types, dev->of_node);
dev->of_node);
drv = (struct mixer_drv_data *)match->data; drv = (struct mixer_drv_data *)match->data;
} else { } else {
drv = (struct mixer_drv_data *) drv = (struct mixer_drv_data *)
...@@ -1251,10 +1265,8 @@ static int mixer_suspend(struct device *dev) ...@@ -1251,10 +1265,8 @@ static int mixer_suspend(struct device *dev)
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev); struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
struct mixer_context *ctx = drm_hdmi_ctx->ctx; struct mixer_context *ctx = drm_hdmi_ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (pm_runtime_suspended(dev)) { if (pm_runtime_suspended(dev)) {
DRM_DEBUG_KMS("%s : Already suspended\n", __func__); DRM_DEBUG_KMS("Already suspended\n");
return 0; return 0;
} }
...@@ -1268,10 +1280,8 @@ static int mixer_resume(struct device *dev) ...@@ -1268,10 +1280,8 @@ static int mixer_resume(struct device *dev)
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev); struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
struct mixer_context *ctx = drm_hdmi_ctx->ctx; struct mixer_context *ctx = drm_hdmi_ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
if (!pm_runtime_suspended(dev)) { if (!pm_runtime_suspended(dev)) {
DRM_DEBUG_KMS("%s : Already resumed\n", __func__); DRM_DEBUG_KMS("Already resumed\n");
return 0; return 0;
} }
...@@ -1287,8 +1297,6 @@ static int mixer_runtime_suspend(struct device *dev) ...@@ -1287,8 +1297,6 @@ static int mixer_runtime_suspend(struct device *dev)
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev); struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
struct mixer_context *ctx = drm_hdmi_ctx->ctx; struct mixer_context *ctx = drm_hdmi_ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mixer_poweroff(ctx); mixer_poweroff(ctx);
return 0; return 0;
...@@ -1299,8 +1307,6 @@ static int mixer_runtime_resume(struct device *dev) ...@@ -1299,8 +1307,6 @@ static int mixer_runtime_resume(struct device *dev)
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev); struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
struct mixer_context *ctx = drm_hdmi_ctx->ctx; struct mixer_context *ctx = drm_hdmi_ctx->ctx;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
mixer_poweron(ctx); mixer_poweron(ctx);
return 0; return 0;
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
#define MXR_CM_COEFF_Y 0x0080 #define MXR_CM_COEFF_Y 0x0080
#define MXR_CM_COEFF_CB 0x0084 #define MXR_CM_COEFF_CB 0x0084
#define MXR_CM_COEFF_CR 0x0088 #define MXR_CM_COEFF_CR 0x0088
#define MXR_MO 0x0304
#define MXR_RESOLUTION 0x0310
#define MXR_GRAPHIC0_BASE_S 0x2024 #define MXR_GRAPHIC0_BASE_S 0x2024
#define MXR_GRAPHIC1_BASE_S 0x2044 #define MXR_GRAPHIC1_BASE_S 0x2044
...@@ -119,6 +122,10 @@ ...@@ -119,6 +122,10 @@
#define MXR_GRP_WH_WIDTH(x) MXR_MASK_VAL(x, 26, 16) #define MXR_GRP_WH_WIDTH(x) MXR_MASK_VAL(x, 26, 16)
#define MXR_GRP_WH_HEIGHT(x) MXR_MASK_VAL(x, 10, 0) #define MXR_GRP_WH_HEIGHT(x) MXR_MASK_VAL(x, 10, 0)
/* bits for MXR_RESOLUTION */
#define MXR_MXR_RES_HEIGHT(x) MXR_MASK_VAL(x, 26, 16)
#define MXR_MXR_RES_WIDTH(x) MXR_MASK_VAL(x, 10, 0)
/* bits for MXR_GRAPHICn_SXY */ /* bits for MXR_GRAPHICn_SXY */
#define MXR_GRP_SXY_SX(x) MXR_MASK_VAL(x, 26, 16) #define MXR_GRP_SXY_SX(x) MXR_MASK_VAL(x, 26, 16)
#define MXR_GRP_SXY_SY(x) MXR_MASK_VAL(x, 10, 0) #define MXR_GRP_SXY_SY(x) MXR_MASK_VAL(x, 10, 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册