Skip to content

Commit 2faa280

Browse files
sandiecao-dcDC-DeepComputing
authored andcommitted
drm/eswin: remove dependency on DRM simple helpers
The simple KMS helpers are deprecated because they only add an intermediate layer between drivers and atomic modesetting. Open-code drm_simple_encoder_init() by calling drm_encoder_init() directly and providing driver-local drm_encoder_funcs. Signed-off-by: Sandie Cao <sandie.cao@deepcomputing.io>
1 parent 6a73b19 commit 2faa280

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎drivers/gpu/drm/eswin/es_dw_hdmi.c‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
#include <drm/drm_edid.h>
3232
#include <drm/drm_of.h>
3333
#include <drm/drm_probe_helper.h>
34-
#include <drm/drm_simple_kms_helper.h>
3534
#include <drm/drm_atomic.h>
3635
#include <drm/drm_atomic_helper.h>
3736
#include <drm/bridge/dw_hdmi.h>
3837
#include <drm/drm_print.h>
3938

4039
#include <drm/drm_mode.h>
40+
#include <drm/drm_encoder.h>
4141
#include <linux/videodev2.h>
4242
#include <linux/media-bus-format.h>
4343
#include <linux/pm_runtime.h>
@@ -274,11 +274,13 @@ static const struct drm_prop_enum_list colorimetry_enum_list[] = {
274274
{ ESWIN_HDMI_COLORIMETRY_BT2020, "ITU_2020" },
275275
};
276276

277+
#if 0
277278
static const struct drm_prop_enum_list quant_range_enum_list[] = {
278279
{ HDMI_QUANTIZATION_RANGE_DEFAULT, "default" },
279280
{ HDMI_QUANTIZATION_RANGE_LIMITED, "limit" },
280281
{ HDMI_QUANTIZATION_RANGE_FULL, "full" },
281282
};
283+
#endif
282284

283285
static const struct drm_prop_enum_list color_depth_capacity_list[] = {
284286
{ BIT(ESWIN_HDMI_DEPTH_8), "8bit" },
@@ -642,6 +644,10 @@ static const struct of_device_id dw_hdmi_eswin_dt_ids[] = {
642644
};
643645
MODULE_DEVICE_TABLE(of, dw_hdmi_eswin_dt_ids);
644646

647+
static const struct drm_encoder_funcs es_encoder_hdmi_funcs = {
648+
.destroy = drm_encoder_cleanup,
649+
};
650+
645651
static int dw_hdmi_eswin_bind(struct device *dev, struct device *master,
646652
void *data)
647653
{
@@ -689,7 +695,8 @@ static int dw_hdmi_eswin_bind(struct device *dev, struct device *master,
689695
plat_data->phy_data = hdmi;
690696

691697
drm_encoder_helper_add(encoder, &dw_hdmi_eswin_encoder_helper_funcs);
692-
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
698+
drm_encoder_init(drm, encoder, &es_encoder_hdmi_funcs,
699+
DRM_MODE_ENCODER_TMDS, NULL);
693700

694701
platform_set_drvdata(pdev, hdmi);
695702

‎drivers/gpu/drm/eswin/es_virtual.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static unsigned char __get_bpp(struct es_virtual_display *vd)
4646

4747
static void vd_dump_destroy(struct es_virtual_display *vd)
4848
{
49-
struct drm_device *drm_dev = vd->encoder.dev;
49+
//struct drm_device *drm_dev = vd->encoder.dev;
5050

5151
if (vd->dump_blob.data) {
5252
vunmap(vd->dump_blob.data);
@@ -161,7 +161,7 @@ static void vd_encoder_enable(struct drm_encoder *encoder)
161161
dc->funcs->dump_enable(vd->dc, vd->dump_obj->iova, vd->pitch);
162162
}
163163

164-
int vd_encoder_atomic_check(struct drm_encoder *encoder,
164+
static int vd_encoder_atomic_check(struct drm_encoder *encoder,
165165
struct drm_crtc_state *crtc_state,
166166
struct drm_connector_state *conn_state)
167167
{

0 commit comments

Comments
 (0)