diff options
author | Inki Dae <inki.dae@samsung.com> | 2011-10-19 04:23:07 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2011-11-15 00:58:45 -0500 |
commit | 74ccc539bcebdb24afb74194223f92a96a7285ed (patch) | |
tree | 95f7826ba5141d0f096a49b0255a74038caf129e /drivers/gpu | |
parent | adb6b1596743e93e50fad2ff26d9604cda4361ab (diff) |
drm/exynos: changed exynos_drm_display to exynos_drm_display_ops
exynos_drm_display has function pointes so exynos_drm_display_ops is better
to describe.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_connector.c | 29 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_encoder.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 |
4 files changed, 23 insertions, 22 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index d33f8039a882..d620b0784257 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c | |||
@@ -104,13 +104,13 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
104 | struct exynos_drm_connector *exynos_connector = | 104 | struct exynos_drm_connector *exynos_connector = |
105 | to_exynos_connector(connector); | 105 | to_exynos_connector(connector); |
106 | struct exynos_drm_manager *manager = exynos_connector->manager; | 106 | struct exynos_drm_manager *manager = exynos_connector->manager; |
107 | struct exynos_drm_display *display = manager->display; | 107 | struct exynos_drm_display_ops *display_ops = manager->display_ops; |
108 | unsigned int count; | 108 | unsigned int count; |
109 | 109 | ||
110 | DRM_DEBUG_KMS("%s\n", __FILE__); | 110 | DRM_DEBUG_KMS("%s\n", __FILE__); |
111 | 111 | ||
112 | if (!display) { | 112 | if (!display_ops) { |
113 | DRM_DEBUG_KMS("display is null.\n"); | 113 | DRM_DEBUG_KMS("display_ops is null.\n"); |
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
@@ -122,7 +122,7 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
122 | * P.S. in case of lcd panel, count is always 1 if success | 122 | * P.S. in case of lcd panel, count is always 1 if success |
123 | * because lcd panel has only one mode. | 123 | * because lcd panel has only one mode. |
124 | */ | 124 | */ |
125 | if (display->get_edid) { | 125 | if (display_ops->get_edid) { |
126 | int ret; | 126 | int ret; |
127 | void *edid; | 127 | void *edid; |
128 | 128 | ||
@@ -132,7 +132,7 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | ret = display->get_edid(manager->dev, connector, | 135 | ret = display_ops->get_edid(manager->dev, connector, |
136 | edid, MAX_EDID); | 136 | edid, MAX_EDID); |
137 | if (ret < 0) { | 137 | if (ret < 0) { |
138 | DRM_ERROR("failed to get edid data.\n"); | 138 | DRM_ERROR("failed to get edid data.\n"); |
@@ -150,8 +150,8 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
150 | struct drm_display_mode *mode = drm_mode_create(connector->dev); | 150 | struct drm_display_mode *mode = drm_mode_create(connector->dev); |
151 | struct fb_videomode *timing; | 151 | struct fb_videomode *timing; |
152 | 152 | ||
153 | if (display->get_timing) | 153 | if (display_ops->get_timing) |
154 | timing = display->get_timing(manager->dev); | 154 | timing = display_ops->get_timing(manager->dev); |
155 | else { | 155 | else { |
156 | drm_mode_destroy(connector->dev, mode); | 156 | drm_mode_destroy(connector->dev, mode); |
157 | return 0; | 157 | return 0; |
@@ -175,7 +175,7 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector, | |||
175 | struct exynos_drm_connector *exynos_connector = | 175 | struct exynos_drm_connector *exynos_connector = |
176 | to_exynos_connector(connector); | 176 | to_exynos_connector(connector); |
177 | struct exynos_drm_manager *manager = exynos_connector->manager; | 177 | struct exynos_drm_manager *manager = exynos_connector->manager; |
178 | struct exynos_drm_display *display = manager->display; | 178 | struct exynos_drm_display_ops *display_ops = manager->display_ops; |
179 | struct fb_videomode timing; | 179 | struct fb_videomode timing; |
180 | int ret = MODE_BAD; | 180 | int ret = MODE_BAD; |
181 | 181 | ||
@@ -183,8 +183,8 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector, | |||
183 | 183 | ||
184 | convert_to_video_timing(&timing, mode); | 184 | convert_to_video_timing(&timing, mode); |
185 | 185 | ||
186 | if (display && display->check_timing) | 186 | if (display_ops && display_ops->check_timing) |
187 | if (!display->check_timing(manager->dev, (void *)&timing)) | 187 | if (!display_ops->check_timing(manager->dev, (void *)&timing)) |
188 | ret = MODE_OK; | 188 | ret = MODE_OK; |
189 | 189 | ||
190 | return ret; | 190 | return ret; |
@@ -226,13 +226,14 @@ exynos_drm_connector_detect(struct drm_connector *connector, bool force) | |||
226 | struct exynos_drm_connector *exynos_connector = | 226 | struct exynos_drm_connector *exynos_connector = |
227 | to_exynos_connector(connector); | 227 | to_exynos_connector(connector); |
228 | struct exynos_drm_manager *manager = exynos_connector->manager; | 228 | struct exynos_drm_manager *manager = exynos_connector->manager; |
229 | struct exynos_drm_display *display = manager->display; | 229 | struct exynos_drm_display_ops *display_ops = |
230 | manager->display_ops; | ||
230 | enum drm_connector_status status = connector_status_disconnected; | 231 | enum drm_connector_status status = connector_status_disconnected; |
231 | 232 | ||
232 | DRM_DEBUG_KMS("%s\n", __FILE__); | 233 | DRM_DEBUG_KMS("%s\n", __FILE__); |
233 | 234 | ||
234 | if (display && display->is_connected) { | 235 | if (display_ops && display_ops->is_connected) { |
235 | if (display->is_connected(manager->dev)) | 236 | if (display_ops->is_connected(manager->dev)) |
236 | status = connector_status_connected; | 237 | status = connector_status_connected; |
237 | else | 238 | else |
238 | status = connector_status_disconnected; | 239 | status = connector_status_disconnected; |
@@ -279,7 +280,7 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev, | |||
279 | 280 | ||
280 | connector = &exynos_connector->drm_connector; | 281 | connector = &exynos_connector->drm_connector; |
281 | 282 | ||
282 | switch (manager->display->type) { | 283 | switch (manager->display_ops->type) { |
283 | case EXYNOS_DISPLAY_TYPE_HDMI: | 284 | case EXYNOS_DISPLAY_TYPE_HDMI: |
284 | type = DRM_MODE_CONNECTOR_HDMIA; | 285 | type = DRM_MODE_CONNECTOR_HDMIA; |
285 | connector->interlace_allowed = true; | 286 | connector->interlace_allowed = true; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index c03683f2ae72..1575e5fef51e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h | |||
@@ -130,7 +130,7 @@ struct exynos_drm_overlay { | |||
130 | * @check_timing: check if timing is valid or not. | 130 | * @check_timing: check if timing is valid or not. |
131 | * @power_on: display device on or off. | 131 | * @power_on: display device on or off. |
132 | */ | 132 | */ |
133 | struct exynos_drm_display { | 133 | struct exynos_drm_display_ops { |
134 | enum exynos_drm_output_type type; | 134 | enum exynos_drm_output_type type; |
135 | bool (*is_connected)(struct device *dev); | 135 | bool (*is_connected)(struct device *dev); |
136 | int (*get_edid)(struct device *dev, struct drm_connector *connector, | 136 | int (*get_edid)(struct device *dev, struct drm_connector *connector, |
@@ -178,7 +178,7 @@ struct exynos_drm_manager { | |||
178 | int pipe; | 178 | int pipe; |
179 | struct exynos_drm_manager_ops *ops; | 179 | struct exynos_drm_manager_ops *ops; |
180 | struct exynos_drm_overlay_ops *overlay_ops; | 180 | struct exynos_drm_overlay_ops *overlay_ops; |
181 | struct exynos_drm_display *display; | 181 | struct exynos_drm_display_ops *display_ops; |
182 | }; | 182 | }; |
183 | 183 | ||
184 | /* | 184 | /* |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 4e5535b2b8e3..0034fa7a58db 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c | |||
@@ -58,11 +58,11 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) | |||
58 | 58 | ||
59 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 59 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
60 | if (connector->encoder == encoder) { | 60 | if (connector->encoder == encoder) { |
61 | struct exynos_drm_display *display = | 61 | struct exynos_drm_display_ops *display_ops = |
62 | manager->display; | 62 | manager->display_ops; |
63 | 63 | ||
64 | if (display && display->power_on) | 64 | if (display_ops && display_ops->power_on) |
65 | display->power_on(manager->dev, mode); | 65 | display_ops->power_on(manager->dev, mode); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | } | 68 | } |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 4659c88cdd9b..f2d883f2999e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -124,7 +124,7 @@ static int fimd_display_power_on(struct device *dev, int mode) | |||
124 | return 0; | 124 | return 0; |
125 | } | 125 | } |
126 | 126 | ||
127 | static struct exynos_drm_display fimd_display = { | 127 | static struct exynos_drm_display_ops fimd_display_ops = { |
128 | .type = EXYNOS_DISPLAY_TYPE_LCD, | 128 | .type = EXYNOS_DISPLAY_TYPE_LCD, |
129 | .is_connected = fimd_display_is_connected, | 129 | .is_connected = fimd_display_is_connected, |
130 | .get_timing = fimd_get_timing, | 130 | .get_timing = fimd_get_timing, |
@@ -731,7 +731,7 @@ static int __devinit fimd_probe(struct platform_device *pdev) | |||
731 | subdrv->manager.pipe = -1; | 731 | subdrv->manager.pipe = -1; |
732 | subdrv->manager.ops = &fimd_manager_ops; | 732 | subdrv->manager.ops = &fimd_manager_ops; |
733 | subdrv->manager.overlay_ops = &fimd_overlay_ops; | 733 | subdrv->manager.overlay_ops = &fimd_overlay_ops; |
734 | subdrv->manager.display = &fimd_display; | 734 | subdrv->manager.display_ops = &fimd_display_ops; |
735 | subdrv->manager.dev = dev; | 735 | subdrv->manager.dev = dev; |
736 | 736 | ||
737 | platform_set_drvdata(pdev, ctx); | 737 | platform_set_drvdata(pdev, ctx); |