diff options
| author | Joonyoung Shim <jy0922.shim@samsung.com> | 2012-04-05 07:49:27 -0400 |
|---|---|---|
| committer | Inki Dae <inki.dae@samsung.com> | 2012-04-12 01:51:27 -0400 |
| commit | 677e84c1b5c8533ea351a9556308071ca47a1eb2 (patch) | |
| tree | 38ab6a72f214433ef294403b6c5cdb3dd25afb0a /drivers/gpu | |
| parent | 578b6065adc8805a8774e4bf3145e18de123f8b2 (diff) | |
drm/exynos: fix to pointer manager member of struct exynos_drm_subdrv
The struct exynos_drm_manager has to exist for exynos drm sub driver
using encoder and connector. If it isn't NULL to member of struct
exynos_drm_subdrv, will create encoder and connector else will not. And
the is_local member also doesn't need.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_core.c | 14 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 20 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 15 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 20 |
5 files changed, 46 insertions, 33 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c b/drivers/gpu/drm/exynos/exynos_drm_core.c index 411832e8e17a..eaf630dc5dba 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_core.c +++ b/drivers/gpu/drm/exynos/exynos_drm_core.c | |||
| @@ -54,16 +54,18 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev, | |||
| 54 | * | 54 | * |
| 55 | * P.S. note that this driver is considered for modularization. | 55 | * P.S. note that this driver is considered for modularization. |
| 56 | */ | 56 | */ |
| 57 | ret = subdrv->probe(dev, subdrv->manager.dev); | 57 | ret = subdrv->probe(dev, subdrv->dev); |
| 58 | if (ret) | 58 | if (ret) |
| 59 | return ret; | 59 | return ret; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | if (subdrv->is_local) | 62 | if (!subdrv->manager) |
| 63 | return 0; | 63 | return 0; |
| 64 | 64 | ||
| 65 | subdrv->manager->dev = subdrv->dev; | ||
| 66 | |||
| 65 | /* create and initialize a encoder for this sub driver. */ | 67 | /* create and initialize a encoder for this sub driver. */ |
| 66 | encoder = exynos_drm_encoder_create(dev, &subdrv->manager, | 68 | encoder = exynos_drm_encoder_create(dev, subdrv->manager, |
| 67 | (1 << MAX_CRTC) - 1); | 69 | (1 << MAX_CRTC) - 1); |
| 68 | if (!encoder) { | 70 | if (!encoder) { |
| 69 | DRM_ERROR("failed to create encoder\n"); | 71 | DRM_ERROR("failed to create encoder\n"); |
| @@ -186,7 +188,7 @@ int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file) | |||
| 186 | 188 | ||
| 187 | list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) { | 189 | list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) { |
| 188 | if (subdrv->open) { | 190 | if (subdrv->open) { |
| 189 | ret = subdrv->open(dev, subdrv->manager.dev, file); | 191 | ret = subdrv->open(dev, subdrv->dev, file); |
| 190 | if (ret) | 192 | if (ret) |
| 191 | goto err; | 193 | goto err; |
| 192 | } | 194 | } |
| @@ -197,7 +199,7 @@ int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file) | |||
| 197 | err: | 199 | err: |
| 198 | list_for_each_entry_reverse(subdrv, &subdrv->list, list) { | 200 | list_for_each_entry_reverse(subdrv, &subdrv->list, list) { |
| 199 | if (subdrv->close) | 201 | if (subdrv->close) |
| 200 | subdrv->close(dev, subdrv->manager.dev, file); | 202 | subdrv->close(dev, subdrv->dev, file); |
| 201 | } | 203 | } |
| 202 | return ret; | 204 | return ret; |
| 203 | } | 205 | } |
| @@ -209,7 +211,7 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file) | |||
| 209 | 211 | ||
| 210 | list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) { | 212 | list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) { |
| 211 | if (subdrv->close) | 213 | if (subdrv->close) |
| 212 | subdrv->close(dev, subdrv->manager.dev, file); | 214 | subdrv->close(dev, subdrv->dev, file); |
| 213 | } | 215 | } |
| 214 | } | 216 | } |
| 215 | EXPORT_SYMBOL_GPL(exynos_drm_subdrv_close); | 217 | EXPORT_SYMBOL_GPL(exynos_drm_subdrv_close); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index fbd0a232c93d..1d814175cd49 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h | |||
| @@ -225,24 +225,25 @@ struct exynos_drm_private { | |||
| 225 | * Exynos drm sub driver structure. | 225 | * Exynos drm sub driver structure. |
| 226 | * | 226 | * |
| 227 | * @list: sub driver has its own list object to register to exynos drm driver. | 227 | * @list: sub driver has its own list object to register to exynos drm driver. |
| 228 | * @dev: pointer to device object for subdrv device driver. | ||
| 228 | * @drm_dev: pointer to drm_device and this pointer would be set | 229 | * @drm_dev: pointer to drm_device and this pointer would be set |
| 229 | * when sub driver calls exynos_drm_subdrv_register(). | 230 | * when sub driver calls exynos_drm_subdrv_register(). |
| 230 | * @is_local: appear encoder and connector disrelated device. | 231 | * @manager: subdrv has its own manager to control a hardware appropriately |
| 232 | * and we can access a hardware drawing on this manager. | ||
| 231 | * @probe: this callback would be called by exynos drm driver after | 233 | * @probe: this callback would be called by exynos drm driver after |
| 232 | * subdrv is registered to it. | 234 | * subdrv is registered to it. |
| 233 | * @remove: this callback is used to release resources created | 235 | * @remove: this callback is used to release resources created |
| 234 | * by probe callback. | 236 | * by probe callback. |
| 235 | * @open: this would be called with drm device file open. | 237 | * @open: this would be called with drm device file open. |
| 236 | * @close: this would be called with drm device file close. | 238 | * @close: this would be called with drm device file close. |
| 237 | * @manager: subdrv has its own manager to control a hardware appropriately | ||
| 238 | * and we can access a hardware drawing on this manager. | ||
| 239 | * @encoder: encoder object owned by this sub driver. | 239 | * @encoder: encoder object owned by this sub driver. |
| 240 | * @connector: connector object owned by this sub driver. | 240 | * @connector: connector object owned by this sub driver. |
| 241 | */ | 241 | */ |
| 242 | struct exynos_drm_subdrv { | 242 | struct exynos_drm_subdrv { |
| 243 | struct list_head list; | 243 | struct list_head list; |
| 244 | struct device *dev; | ||
| 244 | struct drm_device *drm_dev; | 245 | struct drm_device *drm_dev; |
| 245 | bool is_local; | 246 | struct exynos_drm_manager *manager; |
| 246 | 247 | ||
| 247 | int (*probe)(struct drm_device *drm_dev, struct device *dev); | 248 | int (*probe)(struct drm_device *drm_dev, struct device *dev); |
| 248 | void (*remove)(struct drm_device *dev); | 249 | void (*remove)(struct drm_device *dev); |
| @@ -251,7 +252,6 @@ struct exynos_drm_subdrv { | |||
| 251 | void (*close)(struct drm_device *drm_dev, struct device *dev, | 252 | void (*close)(struct drm_device *drm_dev, struct device *dev, |
| 252 | struct drm_file *file); | 253 | struct drm_file *file); |
| 253 | 254 | ||
| 254 | struct exynos_drm_manager manager; | ||
| 255 | struct drm_encoder *encoder; | 255 | struct drm_encoder *encoder; |
| 256 | struct drm_connector *connector; | 256 | struct drm_connector *connector; |
| 257 | }; | 257 | }; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index ecb6db229700..29fdbfeb43cb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
| @@ -172,7 +172,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode) | |||
| 172 | static void fimd_apply(struct device *subdrv_dev) | 172 | static void fimd_apply(struct device *subdrv_dev) |
| 173 | { | 173 | { |
| 174 | struct fimd_context *ctx = get_fimd_context(subdrv_dev); | 174 | struct fimd_context *ctx = get_fimd_context(subdrv_dev); |
| 175 | struct exynos_drm_manager *mgr = &ctx->subdrv.manager; | 175 | struct exynos_drm_manager *mgr = ctx->subdrv.manager; |
| 176 | struct exynos_drm_manager_ops *mgr_ops = mgr->ops; | 176 | struct exynos_drm_manager_ops *mgr_ops = mgr->ops; |
| 177 | struct exynos_drm_overlay_ops *ovl_ops = mgr->overlay_ops; | 177 | struct exynos_drm_overlay_ops *ovl_ops = mgr->overlay_ops; |
| 178 | struct fimd_win_data *win_data; | 178 | struct fimd_win_data *win_data; |
| @@ -577,6 +577,13 @@ static struct exynos_drm_overlay_ops fimd_overlay_ops = { | |||
| 577 | .disable = fimd_win_disable, | 577 | .disable = fimd_win_disable, |
| 578 | }; | 578 | }; |
| 579 | 579 | ||
| 580 | static struct exynos_drm_manager fimd_manager = { | ||
| 581 | .pipe = -1, | ||
| 582 | .ops = &fimd_manager_ops, | ||
| 583 | .overlay_ops = &fimd_overlay_ops, | ||
| 584 | .display_ops = &fimd_display_ops, | ||
| 585 | }; | ||
| 586 | |||
| 580 | static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) | 587 | static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) |
| 581 | { | 588 | { |
| 582 | struct exynos_drm_private *dev_priv = drm_dev->dev_private; | 589 | struct exynos_drm_private *dev_priv = drm_dev->dev_private; |
| @@ -628,7 +635,7 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) | |||
| 628 | struct fimd_context *ctx = (struct fimd_context *)dev_id; | 635 | struct fimd_context *ctx = (struct fimd_context *)dev_id; |
| 629 | struct exynos_drm_subdrv *subdrv = &ctx->subdrv; | 636 | struct exynos_drm_subdrv *subdrv = &ctx->subdrv; |
| 630 | struct drm_device *drm_dev = subdrv->drm_dev; | 637 | struct drm_device *drm_dev = subdrv->drm_dev; |
| 631 | struct exynos_drm_manager *manager = &subdrv->manager; | 638 | struct exynos_drm_manager *manager = subdrv->manager; |
| 632 | u32 val; | 639 | u32 val; |
| 633 | 640 | ||
| 634 | val = readl(ctx->regs + VIDINTCON1); | 641 | val = readl(ctx->regs + VIDINTCON1); |
| @@ -744,7 +751,7 @@ static void fimd_clear_win(struct fimd_context *ctx, int win) | |||
| 744 | static int fimd_power_on(struct fimd_context *ctx, bool enable) | 751 | static int fimd_power_on(struct fimd_context *ctx, bool enable) |
| 745 | { | 752 | { |
| 746 | struct exynos_drm_subdrv *subdrv = &ctx->subdrv; | 753 | struct exynos_drm_subdrv *subdrv = &ctx->subdrv; |
| 747 | struct device *dev = subdrv->manager.dev; | 754 | struct device *dev = subdrv->dev; |
| 748 | 755 | ||
| 749 | DRM_DEBUG_KMS("%s\n", __FILE__); | 756 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 750 | 757 | ||
| @@ -867,13 +874,10 @@ static int __devinit fimd_probe(struct platform_device *pdev) | |||
