Commit aa6c4364 authored by Sam Ravnborg's avatar Sam Ravnborg

drm/panel: drop drm_device from drm_panel

The panel drivers used drm_panel.drm for two purposes:
1) Argument to drm_mode_duplicate()
2) drm->dev was used in error messages

The first usage is replaced with drm_connector.dev
- drm_connector is already connected to a drm_device
  and we have a valid connector

The second usage is replaced with drm_panel.dev
- this makes drivers more consistent in their dev argument
  used for dev_err() and friends

With these replacements there are no more uses of drm_panel.drm,
so it is removed from struct drm_panel.
With this change drm_panel_attach() and drm_panel_detach()
no longer have any use as they are empty functions.

v2:
  - editorial correction in changelog (Laurent)
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Stefan Mavrodiev <stefan@olimex.com>
Cc: Robert Chiras <robert.chiras@nxp.com>
Cc: "Guido Günther" <agx@sigxcpu.org>
Cc: Purism Kernel Team <kernel@puri.sm>
Link: https://patchwork.freedesktop.org/patch/msgid/20191207140353.23967-8-sam@ravnborg.org
parent 06c4a9c2
...@@ -114,11 +114,6 @@ EXPORT_SYMBOL(drm_panel_remove); ...@@ -114,11 +114,6 @@ EXPORT_SYMBOL(drm_panel_remove);
*/ */
int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector)
{ {
if (panel->drm)
return -EBUSY;
panel->drm = connector->dev;
return 0; return 0;
} }
EXPORT_SYMBOL(drm_panel_attach); EXPORT_SYMBOL(drm_panel_attach);
...@@ -135,7 +130,6 @@ EXPORT_SYMBOL(drm_panel_attach); ...@@ -135,7 +130,6 @@ EXPORT_SYMBOL(drm_panel_attach);
*/ */
void drm_panel_detach(struct drm_panel *panel) void drm_panel_detach(struct drm_panel *panel)
{ {
panel->drm = NULL;
} }
EXPORT_SYMBOL(drm_panel_detach); EXPORT_SYMBOL(drm_panel_detach);
......
...@@ -270,7 +270,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel, ...@@ -270,7 +270,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel,
connector->display_info.height_mm = vpanel->panel_type->height_mm; connector->display_info.height_mm = vpanel->panel_type->height_mm;
connector->display_info.bus_flags = vpanel->panel_type->bus_flags; connector->display_info.bus_flags = vpanel->panel_type->bus_flags;
mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode); mode = drm_mode_duplicate(connector->dev, &vpanel->panel_type->mode);
drm_mode_set_name(mode); drm_mode_set_name(mode);
mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
......
...@@ -168,7 +168,7 @@ static int feiyang_get_modes(struct drm_panel *panel, ...@@ -168,7 +168,7 @@ static int feiyang_get_modes(struct drm_panel *panel,
struct feiyang *ctx = panel_to_feiyang(panel); struct feiyang *ctx = panel_to_feiyang(panel);
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &feiyang_default_mode); mode = drm_mode_duplicate(connector->dev, &feiyang_default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", DRM_DEV_ERROR(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n",
feiyang_default_mode.hdisplay, feiyang_default_mode.hdisplay,
......
...@@ -645,6 +645,7 @@ static int ili9322_get_modes(struct drm_panel *panel, ...@@ -645,6 +645,7 @@ static int ili9322_get_modes(struct drm_panel *panel,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct ili9322 *ili = panel_to_ili9322(panel); struct ili9322 *ili = panel_to_ili9322(panel);
struct drm_device *drm = connector->dev;
struct drm_display_mode *mode; struct drm_display_mode *mode;
struct drm_display_info *info; struct drm_display_info *info;
...@@ -663,26 +664,26 @@ static int ili9322_get_modes(struct drm_panel *panel, ...@@ -663,26 +664,26 @@ static int ili9322_get_modes(struct drm_panel *panel,
switch (ili->input) { switch (ili->input) {
case ILI9322_INPUT_SRGB_DUMMY_320X240: case ILI9322_INPUT_SRGB_DUMMY_320X240:
mode = drm_mode_duplicate(panel->drm, &srgb_320x240_mode); mode = drm_mode_duplicate(drm, &srgb_320x240_mode);
break; break;
case ILI9322_INPUT_SRGB_DUMMY_360X240: case ILI9322_INPUT_SRGB_DUMMY_360X240:
mode = drm_mode_duplicate(panel->drm, &srgb_360x240_mode); mode = drm_mode_duplicate(drm, &srgb_360x240_mode);
break; break;
case ILI9322_INPUT_PRGB_THROUGH: case ILI9322_INPUT_PRGB_THROUGH:
case ILI9322_INPUT_PRGB_ALIGNED: case ILI9322_INPUT_PRGB_ALIGNED:
mode = drm_mode_duplicate(panel->drm, &prgb_320x240_mode); mode = drm_mode_duplicate(drm, &prgb_320x240_mode);
break; break;
case ILI9322_INPUT_YUV_640X320_YCBCR: case ILI9322_INPUT_YUV_640X320_YCBCR:
mode = drm_mode_duplicate(panel->drm, &yuv_640x320_mode); mode = drm_mode_duplicate(drm, &yuv_640x320_mode);
break; break;
case ILI9322_INPUT_YUV_720X360_YCBCR: case ILI9322_INPUT_YUV_720X360_YCBCR:
mode = drm_mode_duplicate(panel->drm, &yuv_720x360_mode); mode = drm_mode_duplicate(drm, &yuv_720x360_mode);
break; break;
case ILI9322_INPUT_ITU_R_BT656_720X360_YCBCR: case ILI9322_INPUT_ITU_R_BT656_720X360_YCBCR:
mode = drm_mode_duplicate(panel->drm, &itu_r_bt_656_720_mode); mode = drm_mode_duplicate(drm, &itu_r_bt_656_720_mode);
break; break;
case ILI9322_INPUT_ITU_R_BT656_640X320_YCBCR: case ILI9322_INPUT_ITU_R_BT656_640X320_YCBCR:
mode = drm_mode_duplicate(panel->drm, &itu_r_bt_656_640_mode); mode = drm_mode_duplicate(drm, &itu_r_bt_656_640_mode);
break; break;
default: default:
mode = NULL; mode = NULL;
......
...@@ -393,7 +393,7 @@ static int ili9881c_get_modes(struct drm_panel *panel, ...@@ -393,7 +393,7 @@ static int ili9881c_get_modes(struct drm_panel *panel,
struct ili9881c *ctx = panel_to_ili9881c(panel); struct ili9881c *ctx = panel_to_ili9881c(panel);
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &bananapi_default_mode); mode = drm_mode_duplicate(connector->dev, &bananapi_default_mode);
if (!mode) { if (!mode) {
dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n",
bananapi_default_mode.hdisplay, bananapi_default_mode.hdisplay,
......
...@@ -211,7 +211,7 @@ static int innolux_panel_enable(struct drm_panel *panel) ...@@ -211,7 +211,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
ret = backlight_enable(innolux->backlight); ret = backlight_enable(innolux->backlight);
if (ret) { if (ret) {
DRM_DEV_ERROR(panel->drm->dev, DRM_DEV_ERROR(panel->dev,
"Failed to enable backlight %d\n", ret); "Failed to enable backlight %d\n", ret);
return ret; return ret;
} }
...@@ -410,9 +410,9 @@ static int innolux_panel_get_modes(struct drm_panel *panel, ...@@ -410,9 +410,9 @@ static int innolux_panel_get_modes(struct drm_panel *panel,
const struct drm_display_mode *m = innolux->desc->mode; const struct drm_display_mode *m = innolux->desc->mode;
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, m); mode = drm_mode_duplicate(connector->dev, m);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(panel->drm->dev, "failed to add mode %ux%ux@%u\n", DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
m->hdisplay, m->vdisplay, m->vrefresh); m->hdisplay, m->vdisplay, m->vrefresh);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -307,7 +307,7 @@ static int jdi_panel_get_modes(struct drm_panel *panel, ...@@ -307,7 +307,7 @@ static int jdi_panel_get_modes(struct drm_panel *panel,
struct jdi_panel *jdi = to_jdi_panel(panel); struct jdi_panel *jdi = to_jdi_panel(panel);
struct device *dev = &jdi->dsi->dev; struct device *dev = &jdi->dsi->dev;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
dev_err(dev, "failed to add mode %ux%ux@%u\n", dev_err(dev, "failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
......
...@@ -310,7 +310,7 @@ static int kingdisplay_panel_enable(struct drm_panel *panel) ...@@ -310,7 +310,7 @@ static int kingdisplay_panel_enable(struct drm_panel *panel)
ret = backlight_enable(kingdisplay->backlight); ret = backlight_enable(kingdisplay->backlight);
if (ret) { if (ret) {
DRM_DEV_ERROR(panel->drm->dev, DRM_DEV_ERROR(panel->dev,
"Failed to enable backlight %d\n", ret); "Failed to enable backlight %d\n", ret);
return ret; return ret;
} }
...@@ -338,9 +338,9 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel, ...@@ -338,9 +338,9 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(panel->drm->dev, "failed to add mode %ux%ux@%u\n", DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
default_mode.vrefresh); default_mode.vrefresh);
return -ENOMEM; return -ENOMEM;
......
...@@ -146,7 +146,7 @@ static int lb035q02_get_modes(struct drm_panel *panel, ...@@ -146,7 +146,7 @@ static int lb035q02_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &lb035q02_mode); mode = drm_mode_duplicate(connector->dev, &lb035q02_mode);
if (!mode) if (!mode)
return -ENOMEM; return -ENOMEM;
......
...@@ -214,9 +214,9 @@ static int lg4573_get_modes(struct drm_panel *panel, ...@@ -214,9 +214,9 @@ static int lg4573_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
default_mode.vrefresh); default_mode.vrefresh);
return -ENOMEM; return -ENOMEM;
......
...@@ -112,7 +112,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel, ...@@ -112,7 +112,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
struct panel_lvds *lvds = to_panel_lvds(panel); struct panel_lvds *lvds = to_panel_lvds(panel);
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_create(lvds->panel.drm); mode = drm_mode_create(connector->dev);
if (!mode) if (!mode)
return 0; return 0;
......
...@@ -128,7 +128,7 @@ static int nl8048_get_modes(struct drm_panel *panel, ...@@ -128,7 +128,7 @@ static int nl8048_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &nl8048_mode); mode = drm_mode_duplicate(connector->dev, &nl8048_mode);
if (!mode) if (!mode)
return -ENOMEM; return -ENOMEM;
......
...@@ -213,7 +213,7 @@ static int nt39016_get_modes(struct drm_panel *drm_panel, ...@@ -213,7 +213,7 @@ static int nt39016_get_modes(struct drm_panel *drm_panel,
const struct nt39016_panel_info *panel_info = panel->panel_info; const struct nt39016_panel_info *panel_info = panel->panel_info;
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(drm_panel->drm, &panel_info->display_mode); mode = drm_mode_duplicate(connector->dev, &panel_info->display_mode);
if (!mode) if (!mode)
return -ENOMEM; return -ENOMEM;
......
...@@ -146,7 +146,6 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel, ...@@ -146,7 +146,6 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel,
{ {
struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel);
struct lcd_olinuxino_info *lcd_info = &lcd->eeprom.info; struct lcd_olinuxino_info *lcd_info = &lcd->eeprom.info;
struct drm_device *drm = lcd->panel.drm;
struct lcd_olinuxino_mode *lcd_mode; struct lcd_olinuxino_mode *lcd_mode;
struct drm_display_mode *mode; struct drm_display_mode *mode;
u32 i, num = 0; u32 i, num = 0;
...@@ -155,9 +154,9 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel, ...@@ -155,9 +154,9 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel,
lcd_mode = (struct lcd_olinuxino_mode *) lcd_mode = (struct lcd_olinuxino_mode *)
&lcd->eeprom.reserved[i * sizeof(*lcd_mode)]; &lcd->eeprom.reserved[i * sizeof(*lcd_mode)];
mode = drm_mode_create(drm); mode = drm_mode_create(connector->dev);
if (!mode) { if (!mode) {
dev_err(drm->dev, "failed to add mode %ux%u@%u\n", dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
lcd_mode->hactive, lcd_mode->hactive,
lcd_mode->vactive, lcd_mode->vactive,
lcd_mode->refresh); lcd_mode->refresh);
......
...@@ -354,7 +354,7 @@ static int otm8009a_get_modes(struct drm_panel *panel, ...@@ -354,7 +354,7 @@ static int otm8009a_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_ERROR("failed to add mode %ux%ux@%u\n", DRM_ERROR("failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
......
...@@ -118,9 +118,9 @@ static int osd101t2587_panel_get_modes(struct drm_panel *panel, ...@@ -118,9 +118,9 @@ static int osd101t2587_panel_get_modes(struct drm_panel *panel,
struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel); struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel);
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, osd101t2587->default_mode); mode = drm_mode_duplicate(connector->dev, osd101t2587->default_mode);
if (!mode) { if (!mode) {
dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
osd101t2587->default_mode->hdisplay, osd101t2587->default_mode->hdisplay,
osd101t2587->default_mode->vdisplay, osd101t2587->default_mode->vdisplay,
osd101t2587->default_mode->vrefresh); osd101t2587->default_mode->vrefresh);
......
...@@ -171,11 +171,11 @@ static int wuxga_nt_panel_get_modes(struct drm_panel *panel, ...@@ -171,11 +171,11 @@ static int wuxga_nt_panel_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
default_mode.vrefresh); default_mode.vrefresh);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -312,7 +312,6 @@ static int rpi_touchscreen_enable(struct drm_panel *panel) ...@@ -312,7 +312,6 @@ static int rpi_touchscreen_enable(struct drm_panel *panel)
static int rpi_touchscreen_get_modes(struct drm_panel *panel, static int rpi_touchscreen_get_modes(struct drm_panel *panel,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct drm_device *drm = panel->drm;
unsigned int i, num = 0; unsigned int i, num = 0;
static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
...@@ -320,9 +319,9 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel, ...@@ -320,9 +319,9 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel,
const struct drm_display_mode *m = &rpi_touchscreen_modes[i]; const struct drm_display_mode *m = &rpi_touchscreen_modes[i];
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(drm, m); mode = drm_mode_duplicate(connector->dev, m);
if (!mode) { if (!mode) {
dev_err(drm->dev, "failed to add mode %ux%u@%u\n", dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
m->hdisplay, m->vdisplay, m->vrefresh); m->hdisplay, m->vdisplay, m->vrefresh);
continue; continue;
} }
......
...@@ -441,7 +441,7 @@ static int rad_panel_get_modes(struct drm_panel *panel, ...@@ -441,7 +441,7 @@ static int rad_panel_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n", DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
......
...@@ -340,7 +340,7 @@ static int rm68200_get_modes(struct drm_panel *panel, ...@@ -340,7 +340,7 @@ static int rm68200_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_ERROR("failed to add mode %ux%ux@%u\n", DRM_ERROR("failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
......
...@@ -236,7 +236,7 @@ static int jh057n_get_modes(struct drm_panel *panel, ...@@ -236,7 +236,7 @@ static int jh057n_get_modes(struct drm_panel *panel,
struct jh057n *ctx = panel_to_jh057n(panel); struct jh057n *ctx = panel_to_jh057n(panel);
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n", DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
......
...@@ -127,7 +127,7 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel, ...@@ -127,7 +127,7 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel,
struct drm_display_mode *mode; struct drm_display_mode *mode;
static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(&ctx->dsi->dev, DRM_DEV_ERROR(&ctx->dsi->dev,
"Failed to add mode " DRM_MODE_FMT "\n", "Failed to add mode " DRM_MODE_FMT "\n",
......
...@@ -148,7 +148,7 @@ static int s6d16d0_get_modes(struct drm_panel *panel, ...@@ -148,7 +148,7 @@ static int s6d16d0_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &samsung_s6d16d0_mode); mode = drm_mode_duplicate(connector->dev, &samsung_s6d16d0_mode);
if (!mode) { if (!mode) {
DRM_ERROR("bad mode or failed to add mode\n"); DRM_ERROR("bad mode or failed to add mode\n");
return -EINVAL; return -EINVAL;
......
...@@ -651,7 +651,7 @@ static int s6e3ha2_get_modes(struct drm_panel *panel, ...@@ -651,7 +651,7 @@ static int s6e3ha2_get_modes(struct drm_panel *panel,
struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel); struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel);
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, ctx->desc->mode); mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
if (!mode) { if (!mode) {
DRM_ERROR("failed to add mode %ux%ux@%u\n", DRM_ERROR("failed to add mode %ux%ux@%u\n",
ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
......
...@@ -405,7 +405,7 @@ static int s6e63j0x03_get_modes(struct drm_panel *panel, ...@@ -405,7 +405,7 @@ static int s6e63j0x03_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_ERROR("failed to add mode %ux%ux@%u\n", DRM_ERROR("failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
......
...@@ -367,7 +367,7 @@ static int s6e63m0_get_modes(struct drm_panel *panel, ...@@ -367,7 +367,7 @@ static int s6e63m0_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
DRM_ERROR("failed to add mode %ux%ux@%u\n", DRM_ERROR("failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
......
...@@ -59,7 +59,6 @@ static inline struct seiko_panel *to_seiko_panel(struct drm_panel *panel) ...@@ -59,7 +59,6 @@ static inline struct seiko_panel *to_seiko_panel(struct drm_panel *panel)
static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, static int seiko_panel_get_fixed_modes(struct seiko_panel *panel,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct drm_device *drm = panel->base.drm;
struct drm_display_mode *mode; struct drm_display_mode *mode;
unsigned int i, num = 0; unsigned int i, num = 0;
...@@ -71,9 +70,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, ...@@ -71,9 +70,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel,
struct videomode vm; struct videomode vm;
videomode_from_timing(dt, &vm); videomode_from_timing(dt, &vm);
mode = drm_mode_create(drm); mode = drm_mode_create(connector->dev);
if (!mode) { if (!mode) {
dev_err(drm->dev, "failed to add mode %ux%u\n", dev_err(panel->base.dev, "failed to add mode %ux%u\n",
dt->hactive.typ, dt->vactive.typ); dt->hactive.typ, dt->vactive.typ);
continue; continue;
} }
...@@ -92,9 +91,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel, ...@@ -92,9 +91,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel,
for (i = 0; i < panel->desc->num_modes; i++) { for (i = 0; i < panel->desc->num_modes; i++) {
const struct drm_display_mode *m = &panel->desc->modes[i]; const struct drm_display_mode *m = &panel->desc->modes[i];
mode = drm_mode_duplicate(drm, m); mode = drm_mode_duplicate(connector->dev, m);
if (!mode) { if (!mode) {
dev_err(drm->dev, "failed to add mode %ux%u@%u\n", dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
m->hdisplay, m->vdisplay, m->vrefresh); m->hdisplay, m->vdisplay, m->vrefresh);
continue; continue;
} }
......
...@@ -283,9 +283,9 @@ static int sharp_panel_get_modes(struct drm_panel *panel, ...@@ -283,9 +283,9 @@ static int sharp_panel_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
default_mode.vrefresh); default_mode.vrefresh);
return -ENOMEM; return -ENOMEM;
......
...@@ -105,7 +105,7 @@ static int ls037v7dw01_get_modes(struct drm_panel *panel, ...@@ -105,7 +105,7 @@ static int ls037v7dw01_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &ls037v7dw01_mode); mode = drm_mode_duplicate(connector->dev, &ls037v7dw01_mode);
if (!mode) if (!mode)
return -ENOMEM; return -ENOMEM;
......
...@@ -215,11 +215,11 @@ static int sharp_nt_panel_get_modes(struct drm_panel *panel, ...@@ -215,11 +215,11 @@ static int sharp_nt_panel_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
default_mode.vrefresh); default_mode.vrefresh);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -120,7 +120,6 @@ static inline struct panel_simple *to_panel_simple(struct drm_panel *panel) ...@@ -120,7 +120,6 @@ static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct drm_device *drm = panel->base.drm;
struct drm_display_mode *mode; struct drm_display_mode *mode;
unsigned int i, num = 0; unsigned int i, num = 0;
...@@ -129,9 +128,9 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, ...@@ -129,9 +128,9 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
struct videomode vm; struct videomode vm;
videomode_from_timing(dt, &vm); videomode_from_timing(dt, &vm);
mode = drm_mode_create(drm); mode = drm_mode_create(connector->dev);
if (!mode) { if (!mode) {
dev_err(drm->dev, "failed to add mode %ux%u\n", dev_err(panel->base.dev, "failed to add mode %ux%u\n",
dt->hactive.typ, dt->vactive.typ); dt->hactive.typ, dt->vactive.typ);
continue; continue;
} }
...@@ -153,16 +152,15 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel, ...@@ -153,16 +152,15 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
static unsigned int panel_simple_get_display_modes(struct panel_simple *panel, static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct drm_device *drm = panel->base.drm;
struct drm_display_mode *mode; struct drm_display_mode *mode;
unsigned int i, num = 0; unsigned int i, num = 0;
for (i = 0; i < panel->desc->num_modes; i++) { for (i = 0; i < panel->desc->num_modes; i++) {
const struct drm_display_mode *m = &panel->desc->modes[i]; const struct drm_display_mode *m = &panel->desc->modes[i];
mode = drm_mode_duplicate(drm, m); mode = drm_mode_duplicate(connector->dev, m);
if (!mode) { if (!mode) {
dev_err(drm->dev, "failed to add mode %ux%u@%u\n", dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
m->hdisplay, m->vdisplay, m->vrefresh); m->hdisplay, m->vdisplay, m->vrefresh);
continue; continue;
} }
...@@ -184,7 +182,6 @@ static unsigned int panel_simple_get_display_modes(struct panel_simple *panel, ...@@ -184,7 +182,6 @@ static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
static int panel_simple_get_non_edid_modes(struct panel_simple *panel, static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct drm_device *drm = panel->base.drm;
struct drm_display_mode *mode; struct drm_display_mode *mode;
bool has_override = panel->override_mode.type; bool has_override = panel->override_mode.type;
unsigned int num = 0; unsigned int num = 0;
...@@ -193,12 +190,13 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel, ...@@ -193,12 +190,13 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
return 0; return 0;
if (has_override) { if (has_override) {
mode = drm_mode_duplicate(drm, &panel->override_mode); mode = drm_mode_duplicate(connector->dev,
&panel->override_mode);
if (mode) { if (mode) {
drm_mode_probed_add(connector, mode); drm_mode_probed_add(connector, mode);
num = 1; num = 1;
} else { } else {
dev_err(drm->dev, "failed to add override mode\n"); dev_err(panel->base.dev, "failed to add override mode\n");
} }
} }
......
...@@ -271,7 +271,7 @@ static int st7701_get_modes(struct drm_panel *panel, ...@@ -271,7 +271,7 @@ static int st7701_get_modes(struct drm_panel *panel,
const struct drm_display_mode *desc_mode = st7701->desc->mode; const struct drm_display_mode *desc_mode = st7701->desc->mode;
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, desc_mode); mode = drm_mode_duplicate(connector->dev, desc_mode);
if (!mode) { if (!mode) {
DRM_DEV_ERROR(&st7701->dsi->dev, DRM_DEV_ERROR(&st7701->dsi->dev,
"failed to add mode %ux%ux@%u\n", "failed to add mode %ux%ux@%u\n",
......
...@@ -175,9 +175,9 @@ static int st7789v_get_modes(struct drm_panel *panel, ...@@ -175,9 +175,9 @@ static int st7789v_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &default_mode); mode = drm_mode_duplicate(connector->dev, &default_mode);
if (!mode) { if (!mode) {
dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
default_mode.vrefresh); default_mode.vrefresh);
return -ENOMEM; return -ENOMEM;
......
...@@ -526,7 +526,7 @@ static int acx565akm_get_modes(struct drm_panel *panel, ...@@ -526,7 +526,7 @@ static int acx565akm_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &acx565akm_mode); mode = drm_mode_duplicate(connector->dev, &acx565akm_mode);
if (!mode) if (!mode)
return -ENOMEM; return -ENOMEM;
......
...@@ -292,7 +292,7 @@ static int td028ttec1_get_modes(struct drm_panel *panel, ...@@ -292,7 +292,7 @@ static int td028ttec1_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &td028ttec1_mode); mode = drm_mode_duplicate(connector->dev, &td028ttec1_mode);
if (!mode) if (!mode)
return -ENOMEM; return -ENOMEM;
......
...@@ -351,7 +351,7 @@ static int td043mtea1_get_modes(struct drm_panel *panel, ...@@ -351,7 +351,7 @@ static int td043mtea1_get_modes(struct drm_panel *panel,
{ {
struct drm_display_mode *mode; struct drm_display_mode *mode;
mode = drm_mode_duplicate(panel->drm, &td043mtea1_mode); mode = drm_mode_duplicate(connector->dev, &td043mtea1_mode);
if (!mode) if (!mode)
return -ENOMEM; return -ENOMEM;
......
...@@ -394,7 +394,7 @@ static int tpg110_get_modes(struct drm_panel *panel, ...@@ -394,7 +394,7 @@ static int tpg110_get_modes(struct drm_panel *panel,
connector->display_info.height_mm = tpg->height; connector->display_info.height_mm = tpg->height;
connector->display_info.bus_flags = tpg->panel_mode->bus_flags; connector->display_info.bus_flags = tpg->panel_mode->bus_flags;
mode = drm_mode_duplicate(panel->drm, &tpg->panel_mode->mode); mode = drm_mode_duplicate(connector->dev, &tpg->panel_mode->mode);
drm_mode_set_name(mode); drm_mode_set_name(mode);
mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
......
...@@ -129,13 +129,6 @@ struct drm_panel_funcs { ...@@ -129,13 +129,6 @@ struct drm_panel_funcs {
* struct drm_panel - DRM panel object * struct drm_panel - DRM panel object
*/ */
struct drm_panel { struct drm_panel {
/**
* @drm:
*
* DRM device owning the panel.
*/
struct drm_device *drm;
/** /**
* @dev: * @dev:
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment