Commit 53fa7f72 authored by Thierry Reding's avatar Thierry Reding

drm/tegra: Introduce tegra_drm_client structure

This structure derives from host1x_client. DRM-specific fields are moved
from host1x_client to this structure, so that host1x_client can remain
agnostic of DRM.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent e1e90644
...@@ -1038,30 +1038,30 @@ static int tegra_dc_debugfs_exit(struct tegra_dc *dc) ...@@ -1038,30 +1038,30 @@ static int tegra_dc_debugfs_exit(struct tegra_dc *dc)
return 0; return 0;
} }
static int tegra_dc_drm_init(struct host1x_client *client, static int tegra_dc_init(struct host1x_client *client)
struct drm_device *drm)
{ {
struct tegra_dc *dc = host1x_client_to_dc(client); struct tegra_drm_client *drm = to_tegra_drm_client(client);
struct tegra_dc *dc = tegra_drm_client_to_dc(drm);
int err; int err;
dc->pipe = drm->mode_config.num_crtc; dc->pipe = drm->drm->mode_config.num_crtc;
drm_crtc_init(drm, &dc->base, &tegra_crtc_funcs); drm_crtc_init(drm->drm, &dc->base, &tegra_crtc_funcs);
drm_mode_crtc_set_gamma_size(&dc->base, 256); drm_mode_crtc_set_gamma_size(&dc->base, 256);
drm_crtc_helper_add(&dc->base, &tegra_crtc_helper_funcs); drm_crtc_helper_add(&dc->base, &tegra_crtc_helper_funcs);
err = tegra_dc_rgb_init(drm, dc); err = tegra_dc_rgb_init(drm->drm, dc);
if (err < 0 && err != -ENODEV) { if (err < 0 && err != -ENODEV) {
dev_err(dc->dev, "failed to initialize RGB output: %d\n", err); dev_err(dc->dev, "failed to initialize RGB output: %d\n", err);
return err; return err;
} }
err = tegra_dc_add_planes(drm, dc); err = tegra_dc_add_planes(drm->drm, dc);
if (err < 0) if (err < 0)
return err; return err;
if (IS_ENABLED(CONFIG_DEBUG_FS)) { if (IS_ENABLED(CONFIG_DEBUG_FS)) {
err = tegra_dc_debugfs_init(dc, drm->primary); err = tegra_dc_debugfs_init(dc, drm->drm->primary);
if (err < 0) if (err < 0)
dev_err(dc->dev, "debugfs setup failed: %d\n", err); dev_err(dc->dev, "debugfs setup failed: %d\n", err);
} }
...@@ -1077,9 +1077,10 @@ static int tegra_dc_drm_init(struct host1x_client *client, ...@@ -1077,9 +1077,10 @@ static int tegra_dc_drm_init(struct host1x_client *client,
return 0; return 0;
} }
static int tegra_dc_drm_exit(struct host1x_client *client) static int tegra_dc_exit(struct host1x_client *client)
{ {
struct tegra_dc *dc = host1x_client_to_dc(client); struct tegra_drm_client *drm = to_tegra_drm_client(client);
struct tegra_dc *dc = tegra_drm_client_to_dc(drm);
int err; int err;
devm_free_irq(dc->dev, dc->irq, dc); devm_free_irq(dc->dev, dc->irq, dc);
...@@ -1100,8 +1101,8 @@ static int tegra_dc_drm_exit(struct host1x_client *client) ...@@ -1100,8 +1101,8 @@ static int tegra_dc_drm_exit(struct host1x_client *client)
} }
static const struct host1x_client_ops dc_client_ops = { static const struct host1x_client_ops dc_client_ops = {
.drm_init = tegra_dc_drm_init, .init = tegra_dc_init,
.drm_exit = tegra_dc_drm_exit, .exit = tegra_dc_exit,
}; };
static int tegra_dc_probe(struct platform_device *pdev) static int tegra_dc_probe(struct platform_device *pdev)
...@@ -1140,9 +1141,9 @@ static int tegra_dc_probe(struct platform_device *pdev) ...@@ -1140,9 +1141,9 @@ static int tegra_dc_probe(struct platform_device *pdev)
return -ENXIO; return -ENXIO;
} }
INIT_LIST_HEAD(&dc->client.list); INIT_LIST_HEAD(&dc->client.base.list);
dc->client.ops = &dc_client_ops; dc->client.base.ops = &dc_client_ops;
dc->client.dev = &pdev->dev; dc->client.base.dev = &pdev->dev;
err = tegra_dc_rgb_probe(dc); err = tegra_dc_rgb_probe(dc);
if (err < 0 && err != -ENODEV) { if (err < 0 && err != -ENODEV) {
...@@ -1150,7 +1151,7 @@ static int tegra_dc_probe(struct platform_device *pdev) ...@@ -1150,7 +1151,7 @@ static int tegra_dc_probe(struct platform_device *pdev)
return err; return err;
} }
err = host1x_register_client(tegra, &dc->client); err = host1x_register_client(tegra, &dc->client.base);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "failed to register host1x client: %d\n", dev_err(&pdev->dev, "failed to register host1x client: %d\n",
err); err);
...@@ -1168,7 +1169,7 @@ static int tegra_dc_remove(struct platform_device *pdev) ...@@ -1168,7 +1169,7 @@ static int tegra_dc_remove(struct platform_device *pdev)
struct tegra_dc *dc = platform_get_drvdata(pdev); struct tegra_dc *dc = platform_get_drvdata(pdev);
int err; int err;
err = host1x_unregister_client(tegra, &dc->client); err = host1x_unregister_client(tegra, &dc->client.base);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err); err);
......
...@@ -131,12 +131,18 @@ int tegra_drm_alloc(struct platform_device *pdev) ...@@ -131,12 +131,18 @@ int tegra_drm_alloc(struct platform_device *pdev)
int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm) int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm)
{ {
struct host1x_client *client; struct host1x_client *client;
int err;
mutex_lock(&tegra->clients_lock); mutex_lock(&tegra->clients_lock);
list_for_each_entry(client, &tegra->clients, list) { list_for_each_entry(client, &tegra->clients, list) {
if (client->ops && client->ops->drm_init) { struct tegra_drm_client *tdc = to_tegra_drm_client(client);
int err = client->ops->drm_init(client, drm);
/* associate client with DRM device */
tdc->drm = drm;
if (client->ops && client->ops->init) {
err = client->ops->init(client);
if (err < 0) { if (err < 0) {
dev_err(tegra->dev, dev_err(tegra->dev,
"DRM setup failed for %s: %d\n", "DRM setup failed for %s: %d\n",
...@@ -154,8 +160,9 @@ int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm) ...@@ -154,8 +160,9 @@ int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm)
int tegra_drm_exit(struct tegra_drm *tegra) int tegra_drm_exit(struct tegra_drm *tegra)
{ {
struct platform_device *pdev = to_platform_device(tegra->dev);
struct host1x_client *client; struct host1x_client *client;
struct platform_device *pdev;
int err;
if (!tegra->drm) if (!tegra->drm)
return 0; return 0;
...@@ -163,8 +170,8 @@ int tegra_drm_exit(struct tegra_drm *tegra) ...@@ -163,8 +170,8 @@ int tegra_drm_exit(struct tegra_drm *tegra)
mutex_lock(&tegra->clients_lock); mutex_lock(&tegra->clients_lock);
list_for_each_entry_reverse(client, &tegra->clients, list) { list_for_each_entry_reverse(client, &tegra->clients, list) {
if (client->ops && client->ops->drm_exit) { if (client->ops && client->ops->exit) {
int err = client->ops->drm_exit(client); err = client->ops->exit(client);
if (err < 0) { if (err < 0) {
dev_err(tegra->dev, dev_err(tegra->dev,
"DRM cleanup failed for %s: %d\n", "DRM cleanup failed for %s: %d\n",
...@@ -177,6 +184,7 @@ int tegra_drm_exit(struct tegra_drm *tegra) ...@@ -177,6 +184,7 @@ int tegra_drm_exit(struct tegra_drm *tegra)
mutex_unlock(&tegra->clients_lock); mutex_unlock(&tegra->clients_lock);
pdev = to_platform_device(tegra->dev);
drm_platform_exit(&tegra_drm_driver, pdev); drm_platform_exit(&tegra_drm_driver, pdev);
tegra->drm = NULL; tegra->drm = NULL;
...@@ -409,22 +417,22 @@ static int tegra_open_channel(struct drm_device *drm, void *data, ...@@ -409,22 +417,22 @@ static int tegra_open_channel(struct drm_device *drm, void *data,
struct tegra_drm *tegra = drm->dev_private; struct tegra_drm *tegra = drm->dev_private;
struct drm_tegra_open_channel *args = data; struct drm_tegra_open_channel *args = data;
struct tegra_drm_context *context; struct tegra_drm_context *context;
struct host1x_client *client; struct tegra_drm_client *client;
int err = -ENODEV; int err = -ENODEV;
context = kzalloc(sizeof(*context), GFP_KERNEL); context = kzalloc(sizeof(*context), GFP_KERNEL);
if (!context) if (!context)
return -ENOMEM; return -ENOMEM;
list_for_each_entry(client, &tegra->clients, list) list_for_each_entry(client, &tegra->clients, base.list)
if (client->class == args->client) { if (client->base.class == args->client) {
err = client->ops->open_channel(client, context); err = client->ops->open_channel(client, context);
if (err) if (err)
break; break;
context->client = client;
list_add(&context->list, &fpriv->contexts); list_add(&context->list, &fpriv->contexts);
args->context = (uintptr_t)context; args->context = (uintptr_t)context;
context->client = client;
return 0; return 0;
} }
...@@ -463,10 +471,10 @@ static int tegra_get_syncpt(struct drm_device *drm, void *data, ...@@ -463,10 +471,10 @@ static int tegra_get_syncpt(struct drm_device *drm, void *data,
if (!tegra_drm_file_owns_context(fpriv, context)) if (!tegra_drm_file_owns_context(fpriv, context))
return -ENODEV; return -ENODEV;
if (args->index >= context->client->num_syncpts) if (args->index >= context->client->base.num_syncpts)
return -EINVAL; return -EINVAL;
syncpt = context->client->syncpts[args->index]; syncpt = context->client->base.syncpts[args->index];
args->id = host1x_syncpt_id(syncpt); args->id = host1x_syncpt_id(syncpt);
return 0; return 0;
......
...@@ -44,18 +44,16 @@ struct tegra_drm { ...@@ -44,18 +44,16 @@ struct tegra_drm {
struct tegra_fbdev *fbdev; struct tegra_fbdev *fbdev;
}; };
struct host1x_client; struct tegra_drm_client;
struct tegra_drm_context { struct tegra_drm_context {
struct host1x_client *client; struct tegra_drm_client *client;
struct host1x_channel *channel; struct host1x_channel *channel;
struct list_head list; struct list_head list;
}; };
struct host1x_client_ops { struct tegra_drm_client_ops {
int (*drm_init)(struct host1x_client *client, struct drm_device *drm); int (*open_channel)(struct tegra_drm_client *client,
int (*drm_exit)(struct host1x_client *client);
int (*open_channel)(struct host1x_client *client,
struct tegra_drm_context *context); struct tegra_drm_context *context);
void (*close_channel)(struct tegra_drm_context *context); void (*close_channel)(struct tegra_drm_context *context);
int (*submit)(struct tegra_drm_context *context, int (*submit)(struct tegra_drm_context *context,
...@@ -63,21 +61,19 @@ struct host1x_client_ops { ...@@ -63,21 +61,19 @@ struct host1x_client_ops {
struct drm_file *file); struct drm_file *file);
}; };
struct host1x_client { struct tegra_drm_client {
struct tegra_drm *tegra; struct host1x_client base;
struct device *dev; struct drm_device *drm;
const struct host1x_client_ops *ops;
enum host1x_class class;
struct host1x_channel *channel;
struct host1x_syncpt **syncpts;
unsigned int num_syncpts;
struct list_head list; const struct tegra_drm_client_ops *ops;
}; };
static inline struct tegra_drm_client *
to_tegra_drm_client(struct host1x_client *client)
{
return container_of(client, struct tegra_drm_client, base);
}
extern int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm); extern int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm);
extern int tegra_drm_exit(struct tegra_drm *tegra); extern int tegra_drm_exit(struct tegra_drm *tegra);
...@@ -89,7 +85,7 @@ extern int host1x_unregister_client(struct tegra_drm *tegra, ...@@ -89,7 +85,7 @@ extern int host1x_unregister_client(struct tegra_drm *tegra,
struct tegra_output; struct tegra_output;
struct tegra_dc { struct tegra_dc {
struct host1x_client client; struct tegra_drm_client client;
struct device *dev; struct device *dev;
spinlock_t lock; spinlock_t lock;
...@@ -112,7 +108,8 @@ struct tegra_dc { ...@@ -112,7 +108,8 @@ struct tegra_dc {
struct drm_pending_vblank_event *event; struct drm_pending_vblank_event *event;
}; };
static inline struct tegra_dc *host1x_client_to_dc(struct host1x_client *client) static inline struct tegra_dc *
tegra_drm_client_to_dc(struct tegra_drm_client *client)
{ {
return container_of(client, struct tegra_dc, client); return container_of(client, struct tegra_dc, client);
} }
......
...@@ -27,20 +27,19 @@ ...@@ -27,20 +27,19 @@
#define GR2D_NUM_REGS 0x4d #define GR2D_NUM_REGS 0x4d
struct gr2d { struct gr2d {
struct host1x_client client; struct tegra_drm_client client;
struct host1x_channel *channel; struct host1x_channel *channel;
struct clk *clk; struct clk *clk;
DECLARE_BITMAP(addr_regs, GR2D_NUM_REGS); DECLARE_BITMAP(addr_regs, GR2D_NUM_REGS);
}; };
static inline struct gr2d *to_gr2d(struct host1x_client *client) static inline struct gr2d *to_gr2d(struct tegra_drm_client *client)
{ {
return container_of(client, struct gr2d, client); return container_of(client, struct gr2d, client);
} }
static int gr2d_client_init(struct host1x_client *client, static int gr2d_client_init(struct host1x_client *client)
struct drm_device *drm)
{ {
return 0; return 0;
} }
...@@ -50,7 +49,12 @@ static int gr2d_client_exit(struct host1x_client *client) ...@@ -50,7 +49,12 @@ static int gr2d_client_exit(struct host1x_client *client)
return 0; return 0;
} }
static int gr2d_open_channel(struct host1x_client *client, static const struct host1x_client_ops gr2d_client_ops = {
.init = gr2d_client_init,
.exit = gr2d_client_exit,
};
static int gr2d_open_channel(struct tegra_drm_client *client,
struct tegra_drm_context *context) struct tegra_drm_context *context)
{ {
struct gr2d *gr2d = to_gr2d(client); struct gr2d *gr2d = to_gr2d(client);
...@@ -140,7 +144,7 @@ static int gr2d_submit(struct tegra_drm_context *context, ...@@ -140,7 +144,7 @@ static int gr2d_submit(struct tegra_drm_context *context,
job->num_relocs = args->num_relocs; job->num_relocs = args->num_relocs;
job->num_waitchk = args->num_waitchks; job->num_waitchk = args->num_waitchks;
job->client = (u32)args->context; job->client = (u32)args->context;
job->class = context->client->class; job->class = context->client->base.class;
job->serialize = true; job->serialize = true;
while (num_cmdbufs) { while (num_cmdbufs) {
...@@ -201,7 +205,7 @@ static int gr2d_submit(struct tegra_drm_context *context, ...@@ -201,7 +205,7 @@ static int gr2d_submit(struct tegra_drm_context *context,
if (args->timeout && args->timeout < 10000) if (args->timeout && args->timeout < 10000)
job->timeout = args->timeout; job->timeout = args->timeout;
err = host1x_job_pin(job, context->client->dev); err = host1x_job_pin(job, context->client->base.dev);
if (err) if (err)
goto fail; goto fail;
...@@ -221,9 +225,7 @@ static int gr2d_submit(struct tegra_drm_context *context, ...@@ -221,9 +225,7 @@ static int gr2d_submit(struct tegra_drm_context *context,
return err; return err;
} }
static struct host1x_client_ops gr2d_client_ops = { static const struct tegra_drm_client_ops gr2d_ops = {
.drm_init = gr2d_client_init,
.drm_exit = gr2d_client_exit,
.open_channel = gr2d_open_channel, .open_channel = gr2d_open_channel,
.close_channel = gr2d_close_channel, .close_channel = gr2d_close_channel,
.submit = gr2d_submit, .submit = gr2d_submit,
...@@ -279,13 +281,15 @@ static int gr2d_probe(struct platform_device *pdev) ...@@ -279,13 +281,15 @@ static int gr2d_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
gr2d->client.ops = &gr2d_client_ops; INIT_LIST_HEAD(&gr2d->client.base.list);
gr2d->client.dev = dev; gr2d->client.base.ops = &gr2d_client_ops;
gr2d->client.class = HOST1X_CLASS_GR2D; gr2d->client.base.dev = dev;
gr2d->client.syncpts = syncpts; gr2d->client.base.class = HOST1X_CLASS_GR2D;
gr2d->client.num_syncpts = 1; gr2d->client.base.syncpts = syncpts;
gr2d->client.base.num_syncpts = 1;
gr2d->client.ops = &gr2d_ops;
err = host1x_register_client(tegra, &gr2d->client); err = host1x_register_client(tegra, &gr2d->client.base);
if (err < 0) { if (err < 0) {
dev_err(dev, "failed to register host1x client: %d\n", err); dev_err(dev, "failed to register host1x client: %d\n", err);
return err; return err;
...@@ -307,15 +311,15 @@ static int gr2d_remove(struct platform_device *pdev) ...@@ -307,15 +311,15 @@ static int gr2d_remove(struct platform_device *pdev)
unsigned int i; unsigned int i;
int err; int err;
err = host1x_unregister_client(tegra, &gr2d->client); err = host1x_unregister_client(tegra, &gr2d->client.base);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err); err);
return err; return err;
} }
for (i = 0; i < gr2d->client.num_syncpts; i++) for (i = 0; i < gr2d->client.base.num_syncpts; i++)
host1x_syncpt_free(gr2d->client.syncpts[i]); host1x_syncpt_free(gr2d->client.base.syncpts[i]);
host1x_channel_free(gr2d->channel); host1x_channel_free(gr2d->channel);
clk_disable_unprepare(gr2d->clk); clk_disable_unprepare(gr2d->clk);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "host1x_client.h" #include "host1x_client.h"
struct tegra_hdmi { struct tegra_hdmi {
struct host1x_client client; struct tegra_drm_client client;
struct tegra_output output; struct tegra_output output;
struct device *dev; struct device *dev;
...@@ -43,7 +43,7 @@ struct tegra_hdmi { ...@@ -43,7 +43,7 @@ struct tegra_hdmi {
}; };
static inline struct tegra_hdmi * static inline struct tegra_hdmi *
host1x_client_to_hdmi(struct host1x_client *client) tegra_drm_client_to_hdmi(struct tegra_drm_client *client)
{ {
return container_of(client, struct tegra_hdmi, client); return container_of(client, struct tegra_hdmi, client);
} }
...@@ -1116,24 +1116,24 @@ static int tegra_hdmi_debugfs_exit(struct tegra_hdmi *hdmi) ...@@ -1116,24 +1116,24 @@ static int tegra_hdmi_debugfs_exit(struct tegra_hdmi *hdmi)
return 0; return 0;
} }
static int tegra_hdmi_drm_init(struct host1x_client *client, static int tegra_hdmi_init(struct host1x_client *client)
struct drm_device *drm)
{ {
struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client); struct tegra_drm_client *drm = to_tegra_drm_client(client);
struct tegra_hdmi *hdmi = tegra_drm_client_to_hdmi(drm);
int err; int err;
hdmi->output.type = TEGRA_OUTPUT_HDMI; hdmi->output.type = TEGRA_OUTPUT_HDMI;
hdmi->output.dev = client->dev; hdmi->output.dev = client->dev;
hdmi->output.ops = &hdmi_ops; hdmi->output.ops = &hdmi_ops;
err = tegra_output_init(drm, &hdmi->output); err = tegra_output_init(drm->drm, &hdmi->output);
if (err < 0) { if (err < 0) {
dev_err(client->dev, "output setup failed: %d\n", err); dev_err(client->dev, "output setup failed: %d\n", err);
return err; return err;
} }
if (IS_ENABLED(CONFIG_DEBUG_FS)) { if (IS_ENABLED(CONFIG_DEBUG_FS)) {
err = tegra_hdmi_debugfs_init(hdmi, drm->primary); err = tegra_hdmi_debugfs_init(hdmi, drm->drm->primary);
if (err < 0) if (err < 0)
dev_err(client->dev, "debugfs setup failed: %d\n", err); dev_err(client->dev, "debugfs setup failed: %d\n", err);
} }
...@@ -1141,9 +1141,10 @@ static int tegra_hdmi_drm_init(struct host1x_client *client, ...@@ -1141,9 +1141,10 @@ static int tegra_hdmi_drm_init(struct host1x_client *client,
return 0; return 0;
} }
static int tegra_hdmi_drm_exit(struct host1x_client *client) static int tegra_hdmi_exit(struct host1x_client *client)
{ {
struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client); struct tegra_drm_client *drm = to_tegra_drm_client(client);
struct tegra_hdmi *hdmi = tegra_drm_client_to_hdmi(drm);
int err; int err;
if (IS_ENABLED(CONFIG_DEBUG_FS)) { if (IS_ENABLED(CONFIG_DEBUG_FS)) {
...@@ -1169,8 +1170,8 @@ static int tegra_hdmi_drm_exit(struct host1x_client *client) ...@@ -1169,8 +1170,8 @@ static int tegra_hdmi_drm_exit(struct host1x_client *client)
} }
static const struct host1x_client_ops hdmi_client_ops = { static const struct host1x_client_ops hdmi_client_ops = {
.drm_init = tegra_hdmi_drm_init, .init = tegra_hdmi_init,
.drm_exit = tegra_hdmi_drm_exit, .exit = tegra_hdmi_exit,
}; };
static int tegra_hdmi_probe(struct platform_device *pdev) static int tegra_hdmi_probe(struct platform_device *pdev)
...@@ -1246,11 +1247,11 @@ static int tegra_hdmi_probe(struct platform_device *pdev) ...@@ -1246,11 +1247,11 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
hdmi->irq = err; hdmi->irq = err;
hdmi->client.ops = &hdmi_client_ops; INIT_LIST_HEAD(&hdmi->client.base.list);
INIT_LIST_HEAD(&hdmi->client.list); hdmi->client.base.ops = &hdmi_client_ops;
hdmi->client.dev = &pdev->dev; hdmi->client.base.dev = &pdev->dev;
err = host1x_register_client(tegra, &hdmi->client); err = host1x_register_client(tegra, &hdmi->client.base);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "failed to register host1x client: %d\n", dev_err(&pdev->dev, "failed to register host1x client: %d\n",
err); err);
...@@ -1268,7 +1269,7 @@ static int tegra_hdmi_remove(struct platform_device *pdev) ...@@ -1268,7 +1269,7 @@ static int tegra_hdmi_remove(struct platform_device *pdev)
struct tegra_hdmi *hdmi = platform_get_drvdata(pdev); struct tegra_hdmi *hdmi = platform_get_drvdata(pdev);
int err; int err;
err = host1x_unregister_client(tegra, &hdmi->client); err = host1x_unregister_client(tegra, &hdmi->client.base);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err); err);
......
...@@ -25,4 +25,24 @@ enum host1x_class { ...@@ -25,4 +25,24 @@ enum host1x_class {
HOST1X_CLASS_GR2D_SB = 0x52, HOST1X_CLASS_GR2D_SB = 0x52,
}; };
struct host1x_client;
struct host1x_client_ops {
int (*init)(struct host1x_client *client);
int (*exit)(struct host1x_client *client);
};
struct host1x_client {
struct list_head list;
struct device *dev;
const struct host1x_client_ops *ops;
enum host1x_class class;
struct host1x_channel *channel;
struct host1x_syncpt **syncpts;
unsigned int num_syncpts;
};
#endif #endif
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