Skip to content

Commit cf539cb

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Radeon has two displayport fixes, one for a regression. i915 regression flicker fix needed so 4.0 can get fixed. A bunch of msm fixes and a bunch of exynos fixes, these two are probably a bit larger than I'd like, but most of them seems pretty good" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (29 commits) drm/radeon: fix error flag checking in native aux path drm/radeon: retry dcpd fetch drm/msm/mdp5: fix incorrect parameter for msm_framebuffer_iova() drm/exynos: dp: Lower level of EDID read success message drm/exynos: cleanup exynos_drm_plane drm/exynos: 'win' is always unsigned drm/exynos: mixer: don't dump registers under spinlock drm/exynos: Consolidate return statements in fimd_bind() drm/exynos: Constify exynos_drm_crtc_ops drm/exynos: Fix build breakage on !DRM_EXYNOS_FIMD drm/exynos: mixer: Constify platform_device_id drm/exynos: mixer: cleanup pixelformat handling drm/exynos: mixer: also allow NV21 for the video processor drm/exynos: mixer: remove buffer count handling in vp_video_buffer() drm/exynos: plane: honor buffer offset for dma_addr drm/exynos: fb: use drm_format_num_planes to get buffer count drm/i915: fix screen flickering drm/msm: fix locking inconsistencies in gpu->destroy() drm/msm/dsi: Simplify the code to get the number of read byte drm/msm: Attach assigned encoder to eDP and DSI connectors ...
2 parents 0b6280c + a8106b1 commit cf539cb

30 files changed

+190
-240
lines changed

drivers/gpu/drm/exynos/exynos7_drm_decon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
9191

9292
static void decon_clear_channel(struct decon_context *ctx)
9393
{
94-
int win, ch_enabled = 0;
94+
unsigned int win, ch_enabled = 0;
9595

9696
DRM_DEBUG_KMS("%s\n", __FILE__);
9797

@@ -710,7 +710,7 @@ static void decon_dpms(struct exynos_drm_crtc *crtc, int mode)
710710
}
711711
}
712712

713-
static struct exynos_drm_crtc_ops decon_crtc_ops = {
713+
static const struct exynos_drm_crtc_ops decon_crtc_ops = {
714714
.dpms = decon_dpms,
715715
.mode_fixup = decon_mode_fixup,
716716
.commit = decon_commit,

drivers/gpu/drm/exynos/exynos_dp_core.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <drm/bridge/ptn3460.h>
3333

3434
#include "exynos_dp_core.h"
35-
#include "exynos_drm_fimd.h"
3635

3736
#define ctx_from_connector(c) container_of(c, struct exynos_dp_device, \
3837
connector)
@@ -196,7 +195,7 @@ static int exynos_dp_read_edid(struct exynos_dp_device *dp)
196195
}
197196
}
198197

199-
dev_err(dp->dev, "EDID Read success!\n");
198+
dev_dbg(dp->dev, "EDID Read success!\n");
200199
return 0;
201200
}
202201

@@ -1066,6 +1065,8 @@ static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
10661065

10671066
static void exynos_dp_poweron(struct exynos_dp_device *dp)
10681067
{
1068+
struct exynos_drm_crtc *crtc = dp_to_crtc(dp);
1069+
10691070
if (dp->dpms_mode == DRM_MODE_DPMS_ON)
10701071
return;
10711072

@@ -1076,7 +1077,8 @@ static void exynos_dp_poweron(struct exynos_dp_device *dp)
10761077
}
10771078
}
10781079

1079-
fimd_dp_clock_enable(dp_to_crtc(dp), true);
1080+
if (crtc->ops->clock_enable)
1081+
crtc->ops->clock_enable(dp_to_crtc(dp), true);
10801082

10811083
clk_prepare_enable(dp->clock);
10821084
exynos_dp_phy_init(dp);
@@ -1087,6 +1089,8 @@ static void exynos_dp_poweron(struct exynos_dp_device *dp)
10871089

10881090
static void exynos_dp_poweroff(struct exynos_dp_device *dp)
10891091
{
1092+
struct exynos_drm_crtc *crtc = dp_to_crtc(dp);
1093+
10901094
if (dp->dpms_mode != DRM_MODE_DPMS_ON)
10911095
return;
10921096

@@ -1102,7 +1106,8 @@ static void exynos_dp_poweroff(struct exynos_dp_device *dp)
11021106
exynos_dp_phy_exit(dp);
11031107
clk_disable_unprepare(dp->clock);
11041108

1105-
fimd_dp_clock_enable(dp_to_crtc(dp), false);
1109+
if (crtc->ops->clock_enable)
1110+
crtc->ops->clock_enable(dp_to_crtc(dp), false);
11061111

11071112
if (dp->panel) {
11081113
if (drm_panel_unprepare(dp->panel))

drivers/gpu/drm/exynos/exynos_drm_crtc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ static struct drm_crtc_funcs exynos_crtc_funcs = {
238238
};
239239

240240
struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
241-
struct drm_plane *plane,
242-
int pipe,
243-
enum exynos_drm_output_type type,
244-
struct exynos_drm_crtc_ops *ops,
245-
void *ctx)
241+
struct drm_plane *plane,
242+
int pipe,
243+
enum exynos_drm_output_type type,
244+
const struct exynos_drm_crtc_ops *ops,
245+
void *ctx)
246246
{
247247
struct exynos_drm_crtc *exynos_crtc;
248248
struct exynos_drm_private *private = drm_dev->dev_private;

drivers/gpu/drm/exynos/exynos_drm_crtc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#include "exynos_drm_drv.h"
1919

2020
struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
21-
struct drm_plane *plane,
22-
int pipe,
23-
enum exynos_drm_output_type type,
24-
struct exynos_drm_crtc_ops *ops,
25-
void *context);
21+
struct drm_plane *plane,
22+
int pipe,
23+
enum exynos_drm_output_type type,
24+
const struct exynos_drm_crtc_ops *ops,
25+
void *context);
2626
int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe);
2727
void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe);
2828
void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe);

drivers/gpu/drm/exynos/exynos_drm_drv.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ enum exynos_drm_output_type {
7171
* @dma_addr: array of bus(accessed by dma) address to the memory region
7272
* allocated for a overlay.
7373
* @zpos: order of overlay layer(z position).
74-
* @index_color: if using color key feature then this value would be used
75-
* as index color.
76-
* @default_win: a window to be enabled.
77-
* @color_key: color key on or off.
78-
* @local_path: in case of lcd type, local path mode on or off.
79-
* @transparency: transparency on or off.
80-
* @activated: activated or not.
8174
* @enabled: enabled or not.
8275
* @resume: to resume or not.
8376
*
@@ -108,13 +101,7 @@ struct exynos_drm_plane {
108101
uint32_t pixel_format;
109102
dma_addr_t dma_addr[MAX_FB_BUFFER];
110103
unsigned int zpos;
111-
unsigned int index_color;
112104

113-
bool default_win:1;
114-
bool color_key:1;
115-
bool local_path:1;
116-
bool transparency:1;
117-
bool activated:1;
118105
bool enabled:1;
119106
bool resume:1;
120107
};
@@ -181,6 +168,10 @@ struct exynos_drm_display {
181168
* @win_disable: disable hardware specific overlay.
182169
* @te_handler: trigger to transfer video image at the tearing effect
183170
* synchronization signal if there is a page flip request.
171+
* @clock_enable: optional function enabling/disabling display domain clock,
172+
* called from exynos-dp driver before powering up (with
173+
* 'enable' argument as true) and after powering down (with
174+
* 'enable' as false).
184175
*/
185176
struct exynos_drm_crtc;
186177
struct exynos_drm_crtc_ops {
@@ -195,6 +186,7 @@ struct exynos_drm_crtc_ops {
195186
void (*win_commit)(struct exynos_drm_crtc *crtc, unsigned int zpos);
196187
void (*win_disable)(struct exynos_drm_crtc *crtc, unsigned int zpos);
197188
void (*te_handler)(struct exynos_drm_crtc *crtc);
189+
void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable);
198190
};
199191

200192
/*
@@ -221,7 +213,7 @@ struct exynos_drm_crtc {
221213
unsigned int dpms;
222214
wait_queue_head_t pending_flip_queue;
223215
struct drm_pending_vblank_event *event;
224-
struct exynos_drm_crtc_ops *ops;
216+
const struct exynos_drm_crtc_ops *ops;
225217
void *ctx;
226218
};
227219

drivers/gpu/drm/exynos/exynos_drm_fb.c

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -171,43 +171,6 @@ exynos_drm_framebuffer_init(struct drm_device *dev,
171171
return &exynos_fb->fb;
172172
}
173173

174-
static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd)
175-
{
176-
unsigned int cnt = 0;
177-
178-
if (mode_cmd->pixel_format != DRM_FORMAT_NV12)
179-
return drm_format_num_planes(mode_cmd->pixel_format);
180-
181-
while (cnt != MAX_FB_BUFFER) {
182-
if (!mode_cmd->handles[cnt])
183-
break;
184-
cnt++;
185-
}
186-
187-
/*
188-
* check if NV12 or NV12M.
189-
*
190-
* NV12
191-
* handles[0] = base1, offsets[0] = 0
192-
* handles[1] = base1, offsets[1] = Y_size
193-
*
194-
* NV12M
195-
* handles[0] = base1, offsets[0] = 0
196-
* handles[1] = base2, offsets[1] = 0
197-
*/
198-
if (cnt == 2) {
199-
/*
200-
* in case of NV12 format, offsets[1] is not 0 and
201-
* handles[0] is same as handles[1].
202-
*/
203-
if (mode_cmd->offsets[1] &&
204-
mode_cmd->handles[0] == mode_cmd->handles[1])
205-
cnt = 1;
206-
}
207-
208-
return cnt;
209-
}
210-
211174
static struct drm_framebuffer *
212175
exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
213176
struct drm_mode_fb_cmd2 *mode_cmd)
@@ -230,7 +193,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
230193

231194
drm_helper_mode_fill_fb_struct(&exynos_fb->fb, mode_cmd);
232195
exynos_fb->exynos_gem_obj[0] = to_exynos_gem_obj(obj);
233-
exynos_fb->buf_cnt = exynos_drm_format_num_buffers(mode_cmd);
196+
exynos_fb->buf_cnt = drm_format_num_planes(mode_cmd->pixel_format);
234197

235198
DRM_DEBUG_KMS("buf_cnt = %d\n", exynos_fb->buf_cnt);
236199

drivers/gpu/drm/exynos/exynos_drm_fimd.c

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "exynos_drm_crtc.h"
3434
#include "exynos_drm_plane.h"
3535
#include "exynos_drm_iommu.h"
36-
#include "exynos_drm_fimd.h"
3736

3837
/*
3938
* FIMD stands for Fully Interactive Mobile Display and
@@ -216,7 +215,7 @@ static void fimd_wait_for_vblank(struct exynos_drm_crtc *crtc)
216215
DRM_DEBUG_KMS("vblank wait timed out.\n");
217216
}
218217

219-
static void fimd_enable_video_output(struct fimd_context *ctx, int win,
218+
static void fimd_enable_video_output(struct fimd_context *ctx, unsigned int win,
220219
bool enable)
221220
{
222221
u32 val = readl(ctx->regs + WINCON(win));
@@ -229,7 +228,8 @@ static void fimd_enable_video_output(struct fimd_context *ctx, int win,
229228
writel(val, ctx->regs + WINCON(win));
230229
}
231230

232-
static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
231+
static void fimd_enable_shadow_channel_path(struct fimd_context *ctx,
232+
unsigned int win,
233233
bool enable)
234234
{
235235
u32 val = readl(ctx->regs + SHADOWCON);
@@ -244,7 +244,7 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
244244

245245
static void fimd_clear_channel(struct fimd_context *ctx)
246246
{
247-
int win, ch_enabled = 0;
247+
unsigned int win, ch_enabled = 0;
248248

249249
DRM_DEBUG_KMS("%s\n", __FILE__);
250250

@@ -946,7 +946,24 @@ static void fimd_te_handler(struct exynos_drm_crtc *crtc)
946946
drm_handle_vblank(ctx->drm_dev, ctx->pipe);
947947
}
948948

949-
static struct exynos_drm_crtc_ops fimd_crtc_ops = {
949+
static void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable)
950+
{
951+
struct fimd_context *ctx = crtc->ctx;
952+
u32 val;
953+
954+
/*
955+
* Only Exynos 5250, 5260, 5410 and 542x requires enabling DP/MIE
956+
* clock. On these SoCs the bootloader may enable it but any
957+
* power domain off/on will reset it to disable state.
958+
*/
959+
if (ctx->driver_data != &exynos5_fimd_driver_data)
960+
return;
961+
962+
val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
963+
writel(DP_MIE_CLK_DP_ENABLE, ctx->regs + DP_MIE_CLKCON);
964+
}
965+
966+
static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
950967
.dpms = fimd_dpms,
951968
.mode_fixup = fimd_mode_fixup,
952969
.commit = fimd_commit,
@@ -956,6 +973,7 @@ static struct exynos_drm_crtc_ops fimd_crtc_ops = {
956973
.win_commit = fimd_win_commit,
957974
.win_disable = fimd_win_disable,
958975
.te_handler = fimd_te_handler,
976+
.clock_enable = fimd_dp_clock_enable,
959977
};
960978

961979
static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
@@ -1025,12 +1043,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
10251043
if (ctx->display)
10261044
exynos_drm_create_enc_conn(drm_dev, ctx->display);
10271045

1028-
ret = fimd_iommu_attach_devices(ctx, drm_dev);
1029-
if (ret)
1030-
return ret;
1031-
1032-
return 0;
1033-
1046+
return fimd_iommu_attach_devices(ctx, drm_dev);
10341047
}
10351048

10361049
static void fimd_unbind(struct device *dev, struct device *master,
@@ -1192,24 +1205,6 @@ static int fimd_remove(struct platform_device *pdev)
11921205
return 0;
11931206
}
11941207

1195-
void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable)
1196-
{
1197-
struct fimd_context *ctx = crtc->ctx;
1198-
u32 val;
1199-
1200-
/*
1201-
* Only Exynos 5250, 5260, 5410 and 542x requires enabling DP/MIE
1202-
* clock. On these SoCs the bootloader may enable it but any
1203-
* power domain off/on will reset it to disable state.
1204-
*/
1205-
if (ctx->driver_data != &exynos5_fimd_driver_data)
1206-
return;
1207-
1208-
val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
1209-
writel(DP_MIE_CLK_DP_ENABLE, ctx->regs + DP_MIE_CLKCON);
1210-
}
1211-
EXPORT_SYMBOL_GPL(fimd_dp_clock_enable);
1212-
12131208
struct platform_driver fimd_driver = {
12141209
.probe = fimd_probe,
12151210
.remove = fimd_remove,

drivers/gpu/drm/exynos/exynos_drm_fimd.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

drivers/gpu/drm/exynos/exynos_drm_plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int exynos_check_plane(struct drm_plane *plane, struct drm_framebuffer *fb)
7676
return -EFAULT;
7777
}
7878

79-
exynos_plane->dma_addr[i] = buffer->dma_addr;
79+
exynos_plane->dma_addr[i] = buffer->dma_addr + fb->offsets[i];
8080

8181
DRM_DEBUG_KMS("buffer: %d, dma_addr = 0x%lx\n",
8282
i, (unsigned long)exynos_plane->dma_addr[i]);

drivers/gpu/drm/exynos/exynos_drm_vidi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static int vidi_ctx_initialize(struct vidi_context *ctx,
217217
return 0;
218218
}
219219

220-
static struct exynos_drm_crtc_ops vidi_crtc_ops = {
220+
static const struct exynos_drm_crtc_ops vidi_crtc_ops = {
221221
.dpms = vidi_dpms,
222222
.enable_vblank = vidi_enable_vblank,
223223
.disable_vblank = vidi_disable_vblank,

0 commit comments

Comments
 (0)