Skip to content

Commit d08f44b

Browse files
committed
Merge tag 'exynos-drm-fixes-for-v4.20-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes
Three regressions - Revert frame counter support . This patch fixes a issue which doesn't work extension and clone mode because some CRTC devices don't provide frame counter value properly. - Fix lack of fbdev on Rinato and trats boards. . This patch considers for connector to be registered by DSI after DRM device is registered, and also it makes fbdev initializaion to be done even if no connector at the moment. - Check for dsi->panel object correctly . This patch fixes checking for dsi->panel. of_drm_find_panel function returns panel object or error value so error value should be checked using IS_ERR macro. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Inki Dae <inki.dae@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/1541407733-7632-1-git-send-email-inki.dae@samsung.com
2 parents d99de69 + 989534c commit d08f44b

File tree

5 files changed

+12
-25
lines changed

5 files changed

+12
-25
lines changed

drivers/gpu/drm/exynos/exynos5433_drm_decon.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ static u32 decon_get_frame_count(struct decon_context *ctx, bool end)
164164
return frm;
165165
}
166166

167-
static u32 decon_get_vblank_counter(struct exynos_drm_crtc *crtc)
168-
{
169-
struct decon_context *ctx = crtc->ctx;
170-
171-
return decon_get_frame_count(ctx, false);
172-
}
173-
174167
static void decon_setup_trigger(struct decon_context *ctx)
175168
{
176169
if (!ctx->crtc->i80_mode && !(ctx->out_type & I80_HW_TRG))
@@ -536,7 +529,6 @@ static const struct exynos_drm_crtc_ops decon_crtc_ops = {
536529
.disable = decon_disable,
537530
.enable_vblank = decon_enable_vblank,
538531
.disable_vblank = decon_disable_vblank,
539-
.get_vblank_counter = decon_get_vblank_counter,
540532
.atomic_begin = decon_atomic_begin,
541533
.update_plane = decon_update_plane,
542534
.disable_plane = decon_disable_plane,
@@ -554,7 +546,6 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
554546
int ret;
555547

556548
ctx->drm_dev = drm_dev;
557-
drm_dev->max_vblank_count = 0xffffffff;
558549

559550
for (win = ctx->first_win; win < WINDOWS_NR; win++) {
560551
ctx->configs[win].pixel_formats = decon_formats;

drivers/gpu/drm/exynos/exynos_drm_crtc.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,6 @@ static void exynos_drm_crtc_disable_vblank(struct drm_crtc *crtc)
162162
exynos_crtc->ops->disable_vblank(exynos_crtc);
163163
}
164164

165-
static u32 exynos_drm_crtc_get_vblank_counter(struct drm_crtc *crtc)
166-
{
167-
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
168-
169-
if (exynos_crtc->ops->get_vblank_counter)
170-
return exynos_crtc->ops->get_vblank_counter(exynos_crtc);
171-
172-
return 0;
173-
}
174-
175165
static const struct drm_crtc_funcs exynos_crtc_funcs = {
176166
.set_config = drm_atomic_helper_set_config,
177167
.page_flip = drm_atomic_helper_page_flip,
@@ -181,7 +171,6 @@ static const struct drm_crtc_funcs exynos_crtc_funcs = {
181171
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
182172
.enable_vblank = exynos_drm_crtc_enable_vblank,
183173
.disable_vblank = exynos_drm_crtc_disable_vblank,
184-
.get_vblank_counter = exynos_drm_crtc_get_vblank_counter,
185174
};
186175

187176
struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,

drivers/gpu/drm/exynos/exynos_drm_drv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ struct exynos_drm_crtc_ops {
135135
void (*disable)(struct exynos_drm_crtc *crtc);
136136
int (*enable_vblank)(struct exynos_drm_crtc *crtc);
137137
void (*disable_vblank)(struct exynos_drm_crtc *crtc);
138-
u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc);
139138
enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc,
140139
const struct drm_display_mode *mode);
141140
bool (*mode_fixup)(struct exynos_drm_crtc *crtc,

drivers/gpu/drm/exynos/exynos_drm_dsi.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <drm/drmP.h>
1616
#include <drm/drm_crtc_helper.h>
17+
#include <drm/drm_fb_helper.h>
1718
#include <drm/drm_mipi_dsi.h>
1819
#include <drm/drm_panel.h>
1920
#include <drm/drm_atomic_helper.h>
@@ -1474,12 +1475,12 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder)
14741475
{
14751476
struct exynos_dsi *dsi = encoder_to_dsi(encoder);
14761477
struct drm_connector *connector = &dsi->connector;
1478+
struct drm_device *drm = encoder->dev;
14771479
int ret;
14781480

14791481
connector->polled = DRM_CONNECTOR_POLL_HPD;
14801482

1481-
ret = drm_connector_init(encoder->dev, connector,
1482-
&exynos_dsi_connector_funcs,
1483+
ret = drm_connector_init(drm, connector, &exynos_dsi_connector_funcs,
14831484
DRM_MODE_CONNECTOR_DSI);
14841485
if (ret) {
14851486
DRM_ERROR("Failed to initialize connector with drm\n");
@@ -1489,7 +1490,12 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder)
14891490
connector->status = connector_status_disconnected;
14901491
drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs);
14911492
drm_connector_attach_encoder(connector, encoder);
1493+
if (!drm->registered)
1494+
return 0;
14921495

1496+
connector->funcs->reset(connector);
1497+
drm_fb_helper_add_one_connector(drm->fb_helper, connector);
1498+
drm_connector_register(connector);
14931499
return 0;
14941500
}
14951501

@@ -1527,7 +1533,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
15271533
}
15281534

15291535
dsi->panel = of_drm_find_panel(device->dev.of_node);
1530-
if (dsi->panel) {
1536+
if (IS_ERR(dsi->panel)) {
1537+
dsi->panel = NULL;
1538+
} else {
15311539
drm_panel_attach(dsi->panel, &dsi->connector);
15321540
dsi->connector.status = connector_status_connected;
15331541
}

drivers/gpu/drm/exynos/exynos_drm_fbdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
192192
struct drm_fb_helper *helper;
193193
int ret;
194194

195-
if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector)
195+
if (!dev->mode_config.num_crtc)
196196
return 0;
197197

198198
fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);

0 commit comments

Comments
 (0)