diff options
Diffstat (limited to 'drivers/gpu/drm')
21 files changed, 142 insertions, 153 deletions
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 1d1f1e5e33f0..046bcda36abe 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig | |||
@@ -24,7 +24,7 @@ config DRM_EXYNOS_DMABUF | |||
24 | 24 | ||
25 | config DRM_EXYNOS_FIMD | 25 | config DRM_EXYNOS_FIMD |
26 | bool "Exynos DRM FIMD" | 26 | bool "Exynos DRM FIMD" |
27 | depends on DRM_EXYNOS && !FB_S3C | 27 | depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM |
28 | help | 28 | help |
29 | Choose this option if you want to use Exynos FIMD for DRM. | 29 | Choose this option if you want to use Exynos FIMD for DRM. |
30 | 30 | ||
@@ -48,7 +48,7 @@ config DRM_EXYNOS_G2D | |||
48 | 48 | ||
49 | config DRM_EXYNOS_IPP | 49 | config DRM_EXYNOS_IPP |
50 | bool "Exynos DRM IPP" | 50 | bool "Exynos DRM IPP" |
51 | depends on DRM_EXYNOS | 51 | depends on DRM_EXYNOS && !ARCH_MULTIPLATFORM |
52 | help | 52 | help |
53 | Choose this option if you want to use IPP feature for DRM. | 53 | Choose this option if you want to use IPP feature for DRM. |
54 | 54 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index ab37437bad8a..4c5b6859c9ea 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include "exynos_drm_drv.h" | 18 | #include "exynos_drm_drv.h" |
19 | #include "exynos_drm_encoder.h" | 19 | #include "exynos_drm_encoder.h" |
20 | 20 | ||
21 | #define MAX_EDID 256 | ||
22 | #define to_exynos_connector(x) container_of(x, struct exynos_drm_connector,\ | 21 | #define to_exynos_connector(x) container_of(x, struct exynos_drm_connector,\ |
23 | drm_connector) | 22 | drm_connector) |
24 | 23 | ||
@@ -96,7 +95,9 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
96 | to_exynos_connector(connector); | 95 | to_exynos_connector(connector); |
97 | struct exynos_drm_manager *manager = exynos_connector->manager; | 96 | struct exynos_drm_manager *manager = exynos_connector->manager; |
98 | struct exynos_drm_display_ops *display_ops = manager->display_ops; | 97 | struct exynos_drm_display_ops *display_ops = manager->display_ops; |
99 | unsigned int count; | 98 | struct edid *edid = NULL; |
99 | unsigned int count = 0; | ||
100 | int ret; | ||
100 | 101 | ||
101 | DRM_DEBUG_KMS("%s\n", __FILE__); | 102 | DRM_DEBUG_KMS("%s\n", __FILE__); |
102 | 103 | ||
@@ -114,27 +115,21 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
114 | * because lcd panel has only one mode. | 115 | * because lcd panel has only one mode. |
115 | */ | 116 | */ |
116 | if (display_ops->get_edid) { | 117 | if (display_ops->get_edid) { |
117 | int ret; | 118 | edid = display_ops->get_edid(manager->dev, connector); |
118 | void *edid; | 119 | if (IS_ERR_OR_NULL(edid)) { |
119 | 120 | ret = PTR_ERR(edid); | |
120 | edid = kzalloc(MAX_EDID, GFP_KERNEL); | 121 | edid = NULL; |
121 | if (!edid) { | 122 | DRM_ERROR("Panel operation get_edid failed %d\n", ret); |
122 | DRM_ERROR("failed to allocate edid\n"); | 123 | goto out; |
123 | return 0; | ||
124 | } | 124 | } |
125 | 125 | ||
126 | ret = display_ops->get_edid(manager->dev, connector, | 126 | count = drm_add_edid_modes(connector, edid); |
127 | edid, MAX_EDID); | 127 | if (count < 0) { |
128 | if (ret < 0) { | 128 | DRM_ERROR("Add edid modes failed %d\n", count); |
129 | DRM_ERROR("failed to get edid data.\n"); | 129 | goto out; |
130 | kfree(edid); | ||
131 | edid = NULL; | ||
132 | return 0; | ||
133 | } | 130 | } |
134 | 131 | ||
135 | drm_mode_connector_update_edid_property(connector, edid); | 132 | drm_mode_connector_update_edid_property(connector, edid); |
136 | count = drm_add_edid_modes(connector, edid); | ||
137 | kfree(edid); | ||
138 | } else { | 133 | } else { |
139 | struct exynos_drm_panel_info *panel; | 134 | struct exynos_drm_panel_info *panel; |
140 | struct drm_display_mode *mode = drm_mode_create(connector->dev); | 135 | struct drm_display_mode *mode = drm_mode_create(connector->dev); |
@@ -161,6 +156,8 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector) | |||
161 | count = 1; | 156 | count = 1; |
162 | } | 157 | } |
163 | 158 | ||
159 | out: | ||
160 | kfree(edid); | ||
164 | return count; | 161 | return count; |
165 | } | 162 | } |
166 | 163 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index 9df97714b6c0..ba0a3aa78547 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | |||
@@ -19,6 +19,7 @@ | |||
19 | struct exynos_drm_dmabuf_attachment { | 19 | struct exynos_drm_dmabuf_attachment { |
20 | struct sg_table sgt; | 20 | struct sg_table sgt; |
21 | enum dma_data_direction dir; | 21 | enum dma_data_direction dir; |
22 | bool is_mapped; | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | static int exynos_gem_attach_dma_buf(struct dma_buf *dmabuf, | 25 | static int exynos_gem_attach_dma_buf(struct dma_buf *dmabuf, |
@@ -72,17 +73,10 @@ static struct sg_table * | |||
72 | 73 | ||
73 | DRM_DEBUG_PRIME("%s\n", __FILE__); | 74 | DRM_DEBUG_PRIME("%s\n", __FILE__); |
74 | 75 | ||
75 | if (WARN_ON(dir == DMA_NONE)) | ||
76 | return ERR_PTR(-EINVAL); | ||
77 | |||
78 | /* just return current sgt if already requested. */ | 76 | /* just return current sgt if already requested. */ |
79 | if (exynos_attach->dir == dir) | 77 | if (exynos_attach->dir == dir && exynos_attach->is_mapped) |
80 | return &exynos_attach->sgt; | 78 | return &exynos_attach->sgt; |
81 | 79 | ||
82 | /* reattaching is not allowed. */ | ||
83 | if (WARN_ON(exynos_attach->dir != DMA_NONE)) | ||
84 | return ERR_PTR(-EBUSY); | ||
85 | |||
86 | buf = gem_obj->buffer; | 80 | buf = gem_obj->buffer; |
87 | if (!buf) { | 81 | if (!buf) { |
88 | DRM_ERROR("buffer is null.\n"); | 82 | DRM_ERROR("buffer is null.\n"); |
@@ -107,13 +101,17 @@ static struct sg_table * | |||
107 | wr = sg_next(wr); | 101 | wr = sg_next(wr); |
108 | } | 102 | } |
109 | 103 | ||
110 | nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); | 104 | if (dir != DMA_NONE) { |
111 | if (!nents) { | 105 | nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); |
112 | DRM_ERROR("failed to map sgl with iommu.\n"); | 106 | if (!nents) { |
113 | sgt = ERR_PTR(-EIO); | 107 | DRM_ERROR("failed to map sgl with iommu.\n"); |
114 | goto err_unlock; | 108 | sg_free_table(sgt); |
109 | sgt = ERR_PTR(-EIO); | ||
110 | goto err_unlock; | ||
111 | } | ||
115 | } | 112 | } |
116 | 113 | ||
114 | exynos_attach->is_mapped = true; | ||
117 | exynos_attach->dir = dir; | 115 | exynos_attach->dir = dir; |
118 | attach->priv = exynos_attach; | 116 | attach->priv = exynos_attach; |
119 | 117 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index b9e51bc09e81..4606fac7241a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h | |||
@@ -148,8 +148,8 @@ struct exynos_drm_overlay { | |||
148 | struct exynos_drm_display_ops { | 148 | struct exynos_drm_display_ops { |
149 | enum exynos_drm_output_type type; | 149 | enum exynos_drm_output_type type; |
150 | bool (*is_connected)(struct device *dev); | 150 | bool (*is_connected)(struct device *dev); |
151 | int (*get_edid)(struct device *dev, struct drm_connector *connector, | 151 | struct edid *(*get_edid)(struct device *dev, |
152 | u8 *edid, int len); | 152 | struct drm_connector *connector); |
153 | void *(*get_panel)(struct device *dev); | 153 | void *(*get_panel)(struct device *dev); |
154 | int (*check_timing)(struct device *dev, void *timing); | 154 | int (*check_timing)(struct device *dev, void *timing); |
155 | int (*power_on)(struct device *dev, int mode); | 155 | int (*power_on)(struct device *dev, int mode); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 36c3905536a6..9a4c08e7453c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c | |||
@@ -324,7 +324,7 @@ out: | |||
324 | g2d_userptr = NULL; | 324 | g2d_userptr = NULL; |
325 | } | 325 | } |
326 | 326 | ||
327 | dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, | 327 | static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, |
328 | unsigned long userptr, | 328 | unsigned long userptr, |
329 | unsigned long size, | 329 | unsigned long size, |
330 | struct drm_file *filp, | 330 | struct drm_file *filp, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 850e9950b7da..28644539b305 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c | |||
@@ -108,18 +108,17 @@ static bool drm_hdmi_is_connected(struct device *dev) | |||
108 | return false; | 108 | return false; |
109 | } | 109 | } |
110 | 110 | ||
111 | static int drm_hdmi_get_edid(struct device *dev, | 111 | static struct edid *drm_hdmi_get_edid(struct device *dev, |
112 | struct drm_connector *connector, u8 *edid, int len) | 112 | struct drm_connector *connector) |
113 | { | 113 | { |
114 | struct drm_hdmi_context *ctx = to_context(dev); | 114 | struct drm_hdmi_context *ctx = to_context(dev); |
115 | 115 | ||
116 | DRM_DEBUG_KMS("%s\n", __FILE__); | 116 | DRM_DEBUG_KMS("%s\n", __FILE__); |
117 | 117 | ||
118 | if (hdmi_ops && hdmi_ops->get_edid) | 118 | if (hdmi_ops && hdmi_ops->get_edid) |
119 | return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector, edid, | 119 | return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector); |
120 | len); | ||
121 | 120 | ||
122 | return 0; | 121 | return NULL; |
123 | } | 122 | } |
124 | 123 | ||
125 | static int drm_hdmi_check_timing(struct device *dev, void *timing) | 124 | static int drm_hdmi_check_timing(struct device *dev, void *timing) |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h index 784a7e9a766c..d80516fc9ed7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h | |||
@@ -30,8 +30,8 @@ struct exynos_drm_hdmi_context { | |||
30 | struct exynos_hdmi_ops { | 30 | struct exynos_hdmi_ops { |
31 | /* display */ | 31 | /* display */ |
32 | bool (*is_connected)(void *ctx); | 32 | bool (*is_connected)(void *ctx); |
33 | int (*get_edid)(void *ctx, struct drm_connector *connector, | 33 | struct edid *(*get_edid)(void *ctx, |
34 | u8 *edid, int len); | 34 | struct drm_connector *connector); |
35 | int (*check_timing)(void *ctx, void *timing); | 35 | int (*check_timing)(void *ctx, void *timing); |
36 | int (*power_on)(void *ctx, int mode); | 36 | int (*power_on)(void *ctx, int mode); |
37 | 37 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 0bda96454a02..1a556354e92f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -869,7 +869,7 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node, | |||
869 | } | 869 | } |
870 | } | 870 | } |
871 | 871 | ||
872 | void ipp_handle_cmd_work(struct device *dev, | 872 | static void ipp_handle_cmd_work(struct device *dev, |
873 | struct exynos_drm_ippdrv *ippdrv, | 873 | struct exynos_drm_ippdrv *ippdrv, |
874 | struct drm_exynos_ipp_cmd_work *cmd_work, | 874 | struct drm_exynos_ipp_cmd_work *cmd_work, |
875 | struct drm_exynos_ipp_cmd_node *c_node) | 875 | struct drm_exynos_ipp_cmd_node *c_node) |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index e9e83ef688f0..f976e29def6e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
@@ -734,7 +734,7 @@ static int rotator_remove(struct platform_device *pdev) | |||
734 | return 0; | 734 | return 0; |
735 | } | 735 | } |
736 | 736 | ||
737 | struct rot_limit_table rot_limit_tbl = { | 737 | static struct rot_limit_table rot_limit_tbl = { |
738 | .ycbcr420_2p = { | 738 | .ycbcr420_2p = { |
739 | .min_w = 32, | 739 | .min_w = 32, |
740 | .min_h = 32, | 740 | .min_h = 32, |
@@ -751,7 +751,7 @@ struct rot_limit_table rot_limit_tbl = { | |||
751 | }, | 751 | }, |
752 | }; | 752 | }; |
753 | 753 | ||
754 | struct platform_device_id rotator_driver_ids[] = { | 754 | static struct platform_device_id rotator_driver_ids[] = { |
755 | { | 755 | { |
756 | .name = "exynos-rot", | 756 | .name = "exynos-rot", |
757 | .driver_data = (unsigned long)&rot_limit_tbl, | 757 | .driver_data = (unsigned long)&rot_limit_tbl, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index d0ca3c4e06c6..13ccbd4bcfaa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -98,10 +98,12 @@ static bool vidi_display_is_connected(struct device *dev) | |||
98 | return ctx->connected ? true : false; | 98 | return ctx->connected ? true : false; |
99 | } | 99 | } |
100 | 100 | ||
101 | static int vidi_get_edid(struct device *dev, struct drm_connector *connector, | 101 | static struct edid *vidi_get_edid(struct device *dev, |
102 | u8 *edid, int len) | 102 | struct drm_connector *connector) |
103 | { | 103 | { |
104 | struct vidi_context *ctx = get_vidi_context(dev); | 104 | struct vidi_context *ctx = get_vidi_context(dev); |
105 | struct edid *edid; | ||
106 | int edid_len; | ||
105 | 107 | ||
106 | DRM_DEBUG_KMS("%s\n", __FILE__); | 108 | DRM_DEBUG_KMS("%s\n", __FILE__); |
107 | 109 | ||
@@ -111,13 +113,18 @@ static int vidi_get_edid(struct device *dev, struct drm_connector *connector, | |||
111 | */ | 113 | */ |
112 | if (!ctx->raw_edid) { | 114 | if (!ctx->raw_edid) { |
113 | DRM_DEBUG_KMS("raw_edid is null.\n"); | 115 | DRM_DEBUG_KMS("raw_edid is null.\n"); |
114 | return -EFAULT; | 116 | return ERR_PTR(-EFAULT); |
115 | } | 117 | } |
116 | 118 | ||
117 | memcpy(edid, ctx->raw_edid, min((1 + ctx->raw_edid->extensions) | 119 | edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH; |
118 | * EDID_LENGTH, len)); | 120 | edid = kzalloc(edid_len, GFP_KERNEL); |
121 | if (!edid) { | ||
122 | DRM_DEBUG_KMS("failed to allocate edid\n"); | ||
123 | return ERR_PTR(-ENOMEM); | ||
124 | } | ||
119 | 125 | ||
120 | return 0; | 126 | memcpy(edid, ctx->raw_edid, edid_len); |
127 | return edid; | ||
121 | } | 128 | } |
122 | 129 | ||
123 | static void *vidi_get_panel(struct device *dev) | 130 | static void *vidi_get_panel(struct device *dev) |
@@ -514,7 +521,6 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, | |||
514 | struct exynos_drm_manager *manager; | 521 | struct exynos_drm_manager *manager; |
515 | struct exynos_drm_display_ops *display_ops; | 522 | struct exynos_drm_display_ops *display_ops; |
516 | struct drm_exynos_vidi_connection *vidi = data; | 523 | struct drm_exynos_vidi_connection *vidi = data; |
517 | struct edid *raw_edid; | ||
518 | int edid_len; | 524 | int edid_len; |
519 | 525 | ||
520 | DRM_DEBUG_KMS("%s\n", __FILE__); | 526 | DRM_DEBUG_KMS("%s\n", __FILE__); |
@@ -551,11 +557,11 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, | |||
551 | } | 557 | } |
552 | 558 | ||
553 | if (vidi->connection) { | 559 | if (vidi->connection) { |
554 | if (!vidi->edid) { | 560 | struct edid *raw_edid = (struct edid *)(uint32_t)vidi->edid; |
555 | DRM_DEBUG_KMS("edid data is null.\n"); | 561 | if (!drm_edid_is_valid(raw_edid)) { |
562 | DRM_DEBUG_KMS("edid data is invalid.\n"); | ||
556 | return -EINVAL; | 563 | return -EINVAL; |
557 | } | 564 | } |
558 | raw_edid = (struct edid *)(uint32_t)vidi->edid; | ||
559 | edid_len = (1 + raw_edid->extensions) * EDID_LENGTH; | 565 | edid_len = (1 + raw_edid->extensions) * EDID_LENGTH; |
560 | ctx->raw_edid = kzalloc(edid_len, GFP_KERNEL); | 566 | ctx->raw_edid = kzalloc(edid_len, GFP_KERNEL); |
561 | if (!ctx->raw_edid) { | 567 | if (!ctx->raw_edid) { |
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 41ff79d8ac8e..fbab3c468603 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/regulator/consumer.h> | 34 | #include <linux/regulator/consumer.h> |
35 | #include <linux/io.h> | 35 | #include <linux/io.h> |
36 | #include <linux/of_gpio.h> | 36 | #include <linux/of_gpio.h> |
37 | #include <plat/gpio-cfg.h> | ||
38 | 37 | ||
39 | #include <drm/exynos_drm.h> | 38 | #include <drm/exynos_drm.h> |
40 | 39 | ||
@@ -98,8 +97,7 @@ struct hdmi_context { | |||
98 | 97 | ||
99 | void __iomem *regs; | 98 | void __iomem *regs; |
100 | void *parent_ctx; | 99 | void *parent_ctx; |
101 | int external_irq; | 100 | int irq; |
102 | int internal_irq; | ||
103 | 101 | ||
104 | struct i2c_client *ddc_port; | 102 | struct i2c_client *ddc_port; |
105 | struct i2c_client *hdmiphy_port; | 103 | struct i2c_client *hdmiphy_port; |
@@ -1391,8 +1389,7 @@ static bool hdmi_is_connected(void *ctx) | |||
1391 | return hdata->hpd; | 1389 | return hdata->hpd; |
1392 | } | 1390 | } |
1393 | 1391 | ||
1394 | static int hdmi_get_edid(void *ctx, struct drm_connector *connector, | 1392 | static struct edid *hdmi_get_edid(void *ctx, struct drm_connector *connector) |
1395 | u8 *edid, int len) | ||
1396 | { | 1393 | { |
1397 | struct edid *raw_edid; | 1394 | struct edid *raw_edid; |
1398 | struct hdmi_context *hdata = ctx; | 1395 | struct hdmi_context *hdata = ctx; |
@@ -1400,22 +1397,18 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector, | |||
1400 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); | 1397 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); |
1401 | 1398 | ||
1402 | if (!hdata->ddc_port) | 1399 | if (!hdata->ddc_port) |
1403 | return -ENODEV; | 1400 | return ERR_PTR(-ENODEV); |
1404 | 1401 | ||
1405 | raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter); | 1402 | raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter); |
1406 | if (raw_edid) { | 1403 | if (!raw_edid) |
1407 | hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid); | 1404 | return ERR_PTR(-ENODEV); |
1408 | memcpy(edid, raw_edid, min((1 + raw_edid->extensions) | ||
1409 | * EDID_LENGTH, len)); | ||
1410 | DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n", | ||
1411 | (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"), | ||
1412 | raw_edid->width_cm, raw_edid->height_cm); | ||
1413 | kfree(raw_edid); | ||
1414 | } else { | ||
1415 | return -ENODEV; | ||
1416 | } | ||
1417 | 1405 | ||
1418 | return 0; | 1406 | hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid); |
1407 | DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n", | ||
1408 | (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"), | ||
1409 | raw_edid->width_cm, raw_edid->height_cm); | ||
1410 | |||
1411 | return raw_edid; | ||
1419 | } | 1412 | } |
1420 | 1413 | ||
1421 | static int hdmi_v13_check_timing(struct fb_videomode *check_timing) | 1414 | static int hdmi_v13_check_timing(struct fb_videomode *check_timing) |
@@ -1652,16 +1645,16 @@ static void hdmi_conf_reset(struct hdmi_context *hdata) | |||
1652 | 1645 | ||
1653 | /* resetting HDMI core */ | 1646 | /* resetting HDMI core */ |
1654 | hdmi_reg_writemask(hdata, reg, 0, HDMI_CORE_SW_RSTOUT); | 1647 | hdmi_reg_writemask(hdata, reg, 0, HDMI_CORE_SW_RSTOUT); |
1655 | mdelay(10); | 1648 | usleep_range(10000, 12000); |
1656 | hdmi_reg_writemask(hdata, reg, ~0, HDMI_CORE_SW_RSTOUT); | 1649 | hdmi_reg_writemask(hdata, reg, ~0, HDMI_CORE_SW_RSTOUT); |
1657 | mdelay(10); | 1650 | usleep_range(10000, 12000); |
1658 | } | 1651 | } |
1659 | 1652 | ||
1660 | static void hdmi_conf_init(struct hdmi_context *hdata) | 1653 | static void hdmi_conf_init(struct hdmi_context *hdata) |
1661 | { | 1654 | { |
1662 | struct hdmi_infoframe infoframe; | 1655 | struct hdmi_infoframe infoframe; |
1663 | 1656 | ||
1664 | /* disable HPD interrupts */ | 1657 | /* disable HPD interrupts from HDMI IP block, use GPIO instead */ |
1665 | hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL | | 1658 | hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL | |
1666 | HDMI_INTC_EN_HPD_PLUG | HDMI_INTC_EN_HPD_UNPLUG); | 1659 | HDMI_INTC_EN_HPD_PLUG | HDMI_INTC_EN_HPD_UNPLUG); |
1667 | 1660 | ||
@@ -1779,7 +1772,7 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata) | |||
1779 | u32 val = hdmi_reg_read(hdata, HDMI_V13_PHY_STATUS); | 1772 | u32 val = hdmi_reg_read(hdata, HDMI_V13_PHY_STATUS); |
1780 | if (val & HDMI_PHY_STATUS_READY) | 1773 | if (val & HDMI_PHY_STATUS_READY) |
1781 | break; | 1774 | break; |
1782 | mdelay(1); | 1775 | usleep_range(1000, 2000); |
1783 | } | 1776 | } |
1784 | /* steady state not achieved */ | 1777 | /* steady state not achieved */ |
1785 | if (tries == 0) { | 1778 | if (tries == 0) { |
@@ -1946,7 +1939,7 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata) | |||
1946 | u32 val = hdmi_reg_read(hdata, HDMI_PHY_STATUS_0); | 1939 | u32 val = hdmi_reg_read(hdata, HDMI_PHY_STATUS_0); |
1947 | if (val & HDMI_PHY_STATUS_READY) | 1940 | if (val & HDMI_PHY_STATUS_READY) |
1948 | break; | 1941 | break; |
1949 | mdelay(1); | 1942 | usleep_range(1000, 2000); |
1950 | } | 1943 | } |
1951 | /* steady state not achieved */ | 1944 | /* steady state not achieved */ |
1952 | if (tries == 0) { | 1945 | if (tries == 0) { |
@@ -1998,9 +1991,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata) | |||
1998 | 1991 | ||
1999 | /* reset hdmiphy */ | 1992 | /* reset hdmiphy */ |
2000 | hdmi_reg_writemask(hdata, reg, ~0, HDMI_PHY_SW_RSTOUT); | 1993 | hdmi_reg_writemask(hdata, reg, ~0, HDMI_PHY_SW_RSTOUT); |
2001 | mdelay(10); | 1994 | usleep_range(10000, 12000); |
2002 | hdmi_reg_writemask(hdata, reg, 0, HDMI_PHY_SW_RSTOUT); | 1995 | hdmi_reg_writemask(hdata, reg, 0, HDMI_PHY_SW_RSTOUT); |
2003 | mdelay(10); | 1996 | usleep_range(10000, 12000); |
2004 | } | 1997 | } |
2005 | 1998 | ||
2006 | static void hdmiphy_poweron(struct hdmi_context *hdata) | 1999 | static void hdmiphy_poweron(struct hdmi_context *hdata) |
@@ -2048,7 +2041,7 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata) | |||
2048 | return; | 2041 | return; |
2049 | } | 2042 | } |
2050 | 2043 | ||
2051 | mdelay(10); | 2044 | usleep_range(10000, 12000); |
2052 | 2045 | ||
2053 | /* operation mode */ | 2046 | /* operation mode */ |
2054 | operation[0] = 0x1f; | 2047 | operation[0] = 0x1f; |
@@ -2170,6 +2163,13 @@ static void hdmi_commit(void *ctx) | |||
2170 | 2163 | ||
2171 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); | 2164 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); |
2172 | 2165 | ||
2166 | mutex_lock(&hdata->hdmi_mutex); | ||
2167 | if (!hdata->powered) { | ||
2168 | mutex_unlock(&hdata->hdmi_mutex); | ||
2169 | return; | ||
2170 | } | ||
2171 | mutex_unlock(&hdata->hdmi_mutex); | ||
2172 | |||
2173 | hdmi_conf_apply(hdata); | 2173 | hdmi_conf_apply(hdata); |
2174 | } | 2174 | } |
2175 | 2175 | ||
@@ -2265,7 +2265,7 @@ static struct exynos_hdmi_ops hdmi_ops = { | |||
2265 | .dpms = hdmi_dpms, | 2265 | .dpms = hdmi_dpms, |
2266 | }; | 2266 | }; |
2267 | 2267 | ||
2268 | static irqreturn_t hdmi_external_irq_thread(int irq, void *arg) | 2268 | static irqreturn_t hdmi_irq_thread(int irq, void *arg) |
2269 | { | 2269 | { |
2270 | struct exynos_drm_hdmi_context *ctx = arg; | 2270 | struct exynos_drm_hdmi_context *ctx = arg; |
2271 | struct hdmi_context *hdata = ctx->ctx; | 2271 | struct hdmi_context *hdata = ctx->ctx; |
@@ -2280,31 +2280,6 @@ static irqreturn_t hdmi_external_irq_thread(int irq, void *arg) | |||
2280 | return IRQ_HANDLED; | 2280 | return IRQ_HANDLED; |
2281 | } | 2281 | } |
2282 | 2282 | ||
2283 | static irqreturn_t hdmi_internal_irq_thread(int irq, void *arg) | ||
2284 | { | ||
2285 | struct exynos_drm_hdmi_context *ctx = arg; | ||
2286 | struct hdmi_context *hdata = ctx->ctx; | ||
2287 | u32 intc_flag; | ||
2288 | |||
2289 | intc_flag = hdmi_reg_read(hdata, HDMI_INTC_FLAG); | ||
2290 | /* clearing flags for HPD plug/unplug */ | ||
2291 | if (intc_flag & HDMI_INTC_FLAG_HPD_UNPLUG) { | ||
2292 | DRM_DEBUG_KMS("unplugged\n"); | ||
2293 | hdmi_reg_writemask(hdata, HDMI_INTC_FLAG, ~0, | ||
2294 | HDMI_INTC_FLAG_HPD_UNPLUG); | ||
2295 | } | ||
2296 | if (intc_flag & HDMI_INTC_FLAG_HPD_PLUG) { | ||
2297 | DRM_DEBUG_KMS("plugged\n"); | ||
2298 | hdmi_reg_writemask(hdata, HDMI_INTC_FLAG, ~0, | ||
2299 | HDMI_INTC_FLAG_HPD_PLUG); | ||
2300 | } | ||
2301 | |||
2302 | if (ctx->drm_dev) | ||
2303 | drm_helper_hpd_irq_event(ctx->drm_dev); | ||
2304 | |||
2305 | return IRQ_HANDLED; | ||
2306 | } | ||
2307 | |||
2308 | static int hdmi_resources_init(struct hdmi_context *hdata) | 2283 | static int hdmi_resources_init(struct hdmi_context *hdata) |
2309 | { | 2284 | { |
2310 | struct device *dev = hdata->dev; | 2285 | struct device *dev = hdata->dev; |
@@ -2555,39 +2530,24 @@ static int hdmi_probe(struct platform_device *pdev) | |||
2555 | 2530 | ||
2556 | hdata->hdmiphy_port = hdmi_hdmiphy; | 2531 | hdata->hdmiphy_port = hdmi_hdmiphy; |
2557 | 2532 | ||
2558 | hdata->external_irq = gpio_to_irq(hdata->hpd_gpio); | 2533 | hdata->irq = gpio_to_irq(hdata->hpd_gpio); |
2559 | if (hdata->external_irq < 0) { | 2534 | if (hdata->irq < 0) { |
2560 | DRM_ERROR("failed to get GPIO external irq\n"); | 2535 | DRM_ERROR("failed to get GPIO irq\n"); |
2561 | ret = hdata->external_irq; | 2536 | ret = hdata->irq; |
2562 | goto err_hdmiphy; | ||
2563 | } | ||
2564 | |||
2565 | hdata->internal_irq = platform_get_irq(pdev, 0); | ||
2566 | if (hdata->internal_irq < 0) { | ||
2567 | DRM_ERROR("failed to get platform internal irq\n"); | ||
2568 | ret = hdata->internal_irq; | ||
2569 | goto err_hdmiphy; | 2537 | goto err_hdmiphy; |
2570 | } | 2538 | } |
2571 | 2539 | ||
2572 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); | 2540 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); |
2573 | 2541 | ||
2574 | ret = request_threaded_irq(hdata->external_irq, NULL, | 2542 | ret = request_threaded_irq(hdata->irq, NULL, |
2575 | hdmi_external_irq_thread, IRQF_TRIGGER_RISING | | 2543 | hdmi_irq_thread, IRQF_TRIGGER_RISING | |
2576 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | 2544 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
2577 | "hdmi_external", drm_hdmi_ctx); | 2545 | "hdmi", drm_hdmi_ctx); |
2578 | if (ret) { | 2546 | if (ret) { |
2579 | DRM_ERROR("failed to register hdmi external interrupt\n"); | 2547 | DRM_ERROR("failed to register hdmi interrupt\n"); |
2580 | goto err_hdmiphy; | 2548 | goto err_hdmiphy; |
2581 | } | 2549 | } |
2582 | 2550 | ||
2583 | ret = request_threaded_irq(hdata->internal_irq, NULL, | ||
2584 | hdmi_internal_irq_thread, IRQF_ONESHOT, | ||
2585 | "hdmi_internal", drm_hdmi_ctx); | ||
2586 | if (ret) { | ||
2587 | DRM_ERROR("failed to register hdmi internal interrupt\n"); | ||
2588 | goto err_free_irq; | ||
2589 | } | ||
2590 | |||
2591 | /* Attach HDMI Driver to common hdmi. */ | 2551 | /* Attach HDMI Driver to common hdmi. */ |
2592 | exynos_hdmi_drv_attach(drm_hdmi_ctx); | 2552 | exynos_hdmi_drv_attach(drm_hdmi_ctx); |
2593 | 2553 | ||
@@ -2598,8 +2558,6 @@ static int hdmi_probe(struct platform_device *pdev) | |||
2598 | 2558 | ||
2599 | return 0; | 2559 | return 0; |
2600 | 2560 | ||
2601 | err_free_irq: | ||
2602 | free_irq(hdata->external_irq, drm_hdmi_ctx); | ||
2603 | err_hdmiphy: | 2561 | err_hdmiphy: |
2604 | i2c_del_driver(&hdmiphy_driver); | 2562 | i2c_del_driver(&hdmiphy_driver); |
2605 | err_ddc: | 2563 | err_ddc: |
@@ -2617,8 +2575,7 @@ static int hdmi_remove(struct platform_device *pdev) | |||
2617 | 2575 | ||
2618 | pm_runtime_disable(dev); | 2576 | pm_runtime_disable(dev); |
2619 | 2577 | ||
2620 | free_irq(hdata->internal_irq, hdata); | 2578 | free_irq(hdata->irq, hdata); |
2621 | free_irq(hdata->external_irq, hdata); | ||
2622 | 2579 | ||
2623 | 2580 | ||
2624 | /* hdmiphy i2c driver */ | 2581 | /* hdmiphy i2c driver */ |
@@ -2637,8 +2594,7 @@ static int hdmi_suspend(struct device *dev) | |||
2637 | 2594 | ||
2638 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); | 2595 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); |
2639 | 2596 | ||
2640 | disable_irq(hdata->internal_irq); | 2597 | disable_irq(hdata->irq); |
2641 | disable_irq(hdata->external_irq); | ||
2642 | 2598 | ||
2643 | hdata->hpd = false; | 2599 | hdata->hpd = false; |
2644 | if (ctx->drm_dev) | 2600 | if (ctx->drm_dev) |
@@ -2663,8 +2619,7 @@ static int hdmi_resume(struct device *dev) | |||
2663 | 2619 | ||
2664 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); | 2620 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); |
2665 | 2621 | ||
2666 | enable_irq(hdata->external_irq); | 2622 | enable_irq(hdata->irq); |
2667 | enable_irq(hdata->internal_irq); | ||
2668 | 2623 | ||
2669 | if (!pm_runtime_suspended(dev)) { | 2624 | if (!pm_runtime_suspended(dev)) { |
2670 | DRM_DEBUG_KMS("%s : Already resumed\n", __func__); | 2625 | DRM_DEBUG_KMS("%s : Already resumed\n", __func__); |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index c187ea33b748..c414584bfbae 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -600,7 +600,7 @@ static void vp_win_reset(struct mixer_context *ctx) | |||
600 | /* waiting until VP_SRESET_PROCESSING is 0 */ | 600 | /* waiting until VP_SRESET_PROCESSING is 0 */ |
601 | if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING) | 601 | if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING) |
602 | break; | 602 | break; |
603 | mdelay(10); | 603 | usleep_range(10000, 12000); |
604 | } | 604 | } |
605 | WARN(tries == 0, "failed to reset Video Processor\n"); | 605 | WARN(tries == 0, "failed to reset Video Processor\n"); |
606 | } | 606 | } |
@@ -776,6 +776,13 @@ static void mixer_win_commit(void *ctx, int win) | |||
776 | 776 | ||
777 | DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win); | 777 | DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win); |
778 | 778 | ||
779 | mutex_lock(&mixer_ctx->mixer_mutex); | ||
780 | if (!mixer_ctx->powered) { | ||
781 | mutex_unlock(&mixer_ctx->mixer_mutex); | ||
782 | return; | ||
783 | } | ||
784 | mutex_unlock(&mixer_ctx->mixer_mutex); | ||
785 | |||
779 | if (win > 1 && mixer_ctx->vp_enabled) | 786 | if (win > 1 && mixer_ctx->vp_enabled) |
780 | vp_video_buffer(mixer_ctx, win); | 787 | vp_video_buffer(mixer_ctx, win); |
781 | else | 788 | else |
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 7944d301518a..9d4a2c2adf0e 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/debugfs.h> | 30 | #include <linux/debugfs.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/export.h> | 32 | #include <linux/export.h> |
33 | #include <generated/utsrelease.h> | ||
33 | #include <drm/drmP.h> | 34 | #include <drm/drmP.h> |
34 | #include "intel_drv.h" | 35 | #include "intel_drv.h" |
35 | #include "intel_ringbuffer.h" | 36 | #include "intel_ringbuffer.h" |
@@ -690,6 +691,7 @@ static int i915_error_state(struct seq_file *m, void *unused) | |||
690 | 691 | ||
691 | seq_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec, | 692 | seq_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec, |
692 | error->time.tv_usec); | 693 | error->time.tv_usec); |
694 | seq_printf(m, "Kernel: " UTS_RELEASE); | ||
693 | seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device); | 695 | seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device); |
694 | seq_printf(m, "EIR: 0x%08x\n", error->eir); | 696 | seq_printf(m, "EIR: 0x%08x\n", error->eir); |
695 | seq_printf(m, "IER: 0x%08x\n", error->ier); | 697 | seq_printf(m, "IER: 0x%08x\n", error->ier); |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index b401788e1791..59afb7eb6db6 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -533,6 +533,7 @@ | |||
533 | #define MI_MODE 0x0209c | 533 | #define MI_MODE 0x0209c |
534 | # define VS_TIMER_DISPATCH (1 << 6) | 534 | # define VS_TIMER_DISPATCH (1 << 6) |
535 | # define MI_FLUSH_ENABLE (1 << 12) | 535 | # define MI_FLUSH_ENABLE (1 << 12) |
536 | # define ASYNC_FLIP_PERF_DISABLE (1 << 14) | ||
536 | 537 | ||
537 | #define GEN6_GT_MODE 0x20d0 | 538 | #define GEN6_GT_MODE 0x20d0 |
538 | #define GEN6_GT_MODE_HI (1 << 9) | 539 | #define GEN6_GT_MODE_HI (1 << 9) |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index ae253e04c391..42ff97d667d2 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -505,13 +505,25 @@ static int init_render_ring(struct intel_ring_buffer *ring) | |||
505 | struct drm_i915_private *dev_priv = dev->dev_private; | 505 | struct drm_i915_private *dev_priv = dev->dev_private; |
506 | int ret = init_ring_common(ring); | 506 | int ret = init_ring_common(ring); |
507 | 507 | ||
508 | if (INTEL_INFO(dev)->gen > 3) { | 508 | if (INTEL_INFO(dev)->gen > 3) |
509 | I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH)); | 509 | I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH)); |
510 | if (IS_GEN7(dev)) | 510 | |
511 | I915_WRITE(GFX_MODE_GEN7, | 511 | /* We need to disable the AsyncFlip performance optimisations in order |
512 | _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) | | 512 | * to use MI_WAIT_FOR_EVENT within the CS. It should already be |
513 | _MASKED_BIT_ENABLE(GFX_REPLAY_MODE)); | 513 | * programmed to '1' on all products. |
514 | } | 514 | */ |
515 | if (INTEL_INFO(dev)->gen >= 6) | ||
516 | I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(ASYNC_FLIP_PERF_DISABLE)); | ||
517 | |||
518 | /* Required for the hardware to program scanline values for waiting */ | ||
519 | if (INTEL_INFO(dev)->gen == 6) | ||
520 | I915_WRITE(GFX_MODE, | ||
521 | _MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_ALWAYS)); | ||
522 | |||
523 | if (IS_GEN7(dev)) | ||
524 | I915_WRITE(GFX_MODE_GEN7, | ||
525 | _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) | | ||
526 | _MASKED_BIT_ENABLE(GFX_REPLAY_MODE)); | ||
515 | 527 | ||
516 | if (INTEL_INFO(dev)->gen >= 5) { | 528 | if (INTEL_INFO(dev)->gen >= 5) { |
517 | ret = init_pipe_control(ring); | 529 | ret = init_pipe_control(ring); |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 59acabb45c9b..835992d8d067 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -1216,7 +1216,7 @@ void cayman_dma_stop(struct radeon_device *rdev) | |||
1216 | int cayman_dma_resume(struct radeon_device *rdev) | 1216 | int cayman_dma_resume(struct radeon_device *rdev) |
1217 | { | 1217 | { |
1218 | struct radeon_ring *ring; | 1218 | struct radeon_ring *ring; |
1219 | u32 rb_cntl, dma_cntl; | 1219 | u32 rb_cntl, dma_cntl, ib_cntl; |
1220 | u32 rb_bufsz; | 1220 | u32 rb_bufsz; |
1221 | u32 reg_offset, wb_offset; | 1221 | u32 reg_offset, wb_offset; |
1222 | int i, r; | 1222 | int i, r; |
@@ -1265,7 +1265,11 @@ int cayman_dma_resume(struct radeon_device *rdev) | |||
1265 | WREG32(DMA_RB_BASE + reg_offset, ring->gpu_addr >> 8); | 1265 | WREG32(DMA_RB_BASE + reg_offset, ring->gpu_addr >> 8); |
1266 | 1266 | ||
1267 | /* enable DMA IBs */ | 1267 | /* enable DMA IBs */ |
1268 | WREG32(DMA_IB_CNTL + reg_offset, DMA_IB_ENABLE | CMD_VMID_FORCE); | 1268 | ib_cntl = DMA_IB_ENABLE | CMD_VMID_FORCE; |
1269 | #ifdef __BIG_ENDIAN | ||
1270 | ib_cntl |= DMA_IB_SWAP_ENABLE; | ||
1271 | #endif | ||
1272 | WREG32(DMA_IB_CNTL + reg_offset, ib_cntl); | ||
1269 | 1273 | ||
1270 | dma_cntl = RREG32(DMA_CNTL + reg_offset); | 1274 | dma_cntl = RREG32(DMA_CNTL + reg_offset); |
1271 | dma_cntl &= ~CTXEMPTY_INT_ENABLE; | 1275 | dma_cntl &= ~CTXEMPTY_INT_ENABLE; |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 3cb9d6089373..bc2540b17c5e 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2313,7 +2313,7 @@ void r600_dma_stop(struct radeon_device *rdev) | |||
2313 | int r600_dma_resume(struct radeon_device *rdev) | 2313 | int r600_dma_resume(struct radeon_device *rdev) |
2314 | { | 2314 | { |
2315 | struct radeon_ring *ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX]; | 2315 | struct radeon_ring *ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX]; |
2316 | u32 rb_cntl, dma_cntl; | 2316 | u32 rb_cntl, dma_cntl, ib_cntl; |
2317 | u32 rb_bufsz; | 2317 | u32 rb_bufsz; |
2318 | int r; | 2318 | int r; |
2319 | 2319 | ||
@@ -2353,7 +2353,11 @@ int r600_dma_resume(struct radeon_device *rdev) | |||
2353 | WREG32(DMA_RB_BASE, ring->gpu_addr >> 8); | 2353 | WREG32(DMA_RB_BASE, ring->gpu_addr >> 8); |
2354 | 2354 | ||
2355 | /* enable DMA IBs */ | 2355 | /* enable DMA IBs */ |
2356 | WREG32(DMA_IB_CNTL, DMA_IB_ENABLE); | 2356 | ib_cntl = DMA_IB_ENABLE; |
2357 | #ifdef __BIG_ENDIAN | ||
2358 | ib_cntl |= DMA_IB_SWAP_ENABLE; | ||
2359 | #endif | ||
2360 | WREG32(DMA_IB_CNTL, ib_cntl); | ||
2357 | 2361 | ||
2358 | dma_cntl = RREG32(DMA_CNTL); | 2362 | dma_cntl = RREG32(DMA_CNTL); |
2359 | dma_cntl &= ~CTXEMPTY_INT_ENABLE; | 2363 | dma_cntl &= ~CTXEMPTY_INT_ENABLE; |
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 469661fd1903..5407459e56d2 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
@@ -286,6 +286,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) | |||
286 | p->chunks[p->chunk_ib_idx].kpage[1] == NULL) { | 286 | p->chunks[p->chunk_ib_idx].kpage[1] == NULL) { |
287 | kfree(p->chunks[p->chunk_ib_idx].kpage[0]); | 287 | kfree(p->chunks[p->chunk_ib_idx].kpage[0]); |
288 | kfree(p->chunks[p->chunk_ib_idx].kpage[1]); | 288 | kfree(p->chunks[p->chunk_ib_idx].kpage[1]); |
289 | p->chunks[p->chunk_ib_idx].kpage[0] = NULL; | ||
290 | p->chunks[p->chunk_ib_idx].kpage[1] = NULL; | ||
289 | return -ENOMEM; | 291 | return -ENOMEM; |
290 | } | 292 | } |
291 | } | 293 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index ad6df625e8b8..0d67674b64b1 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c | |||
@@ -241,7 +241,8 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, | |||
241 | y = 0; | 241 | y = 0; |
242 | } | 242 | } |
243 | 243 | ||
244 | if (ASIC_IS_AVIVO(rdev)) { | 244 | /* fixed on DCE6 and newer */ |
245 | if (ASIC_IS_AVIVO(rdev) && !ASIC_IS_DCE6(rdev)) { | ||
245 | int i = 0; | 246 | int i = 0; |
246 | struct drm_crtc *crtc_p; | 247 | struct drm_crtc *crtc_p; |
247 | 248 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index edfc54e41842..0d6562bb0c93 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -429,7 +429,8 @@ bool radeon_card_posted(struct radeon_device *rdev) | |||
429 | { | 429 | { |
430 | uint32_t reg; | 430 | uint32_t reg; |
431 | 431 | ||
432 | if (efi_enabled && rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) | 432 | if (efi_enabled(EFI_BOOT) && |
433 | rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) | ||
433 | return false; | 434 | return false; |
434 | 435 | ||
435 | /* first check CRTCs */ | 436 | /* first check CRTCs */ |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 1da2386d7cf7..ff3def784619 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -1122,7 +1122,7 @@ radeon_user_framebuffer_create(struct drm_device *dev, | |||
1122 | if (ret) { | 1122 | if (ret) { |
1123 | kfree(radeon_fb); | 1123 | kfree(radeon_fb); |
1124 | drm_gem_object_unreference_unlocked(obj); | 1124 | drm_gem_object_unreference_unlocked(obj); |
1125 | return NULL; | 1125 | return ERR_PTR(ret); |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | return &radeon_fb->base; | 1128 | return &radeon_fb->base; |