/** * struct gth_output - GTH view on an output port * @gth: backlink to the GTH device * @output: link to output device's output descriptor * @index: output port number * @port_type: one of GTH_* port type values * @master: bitmap of masters configured for this output
*/ struct gth_output { struct gth_device *gth; struct intel_th_output *output; unsignedint index; unsignedint port_type;
DECLARE_BITMAP(master, TH_CONFIGURABLE_MASTERS + 1);
};
if (kstrtoint(buf, 10, &port) < 0) return -EINVAL;
if (port >= TH_POSSIBLE_OUTPUTS || port < -1) return -EINVAL;
spin_lock(>h->gth_lock);
/* disconnect from the previous output port, if any */
old_port = gth->master[ma->master]; if (old_port >= 0) {
gth->master[ma->master] = -1;
clear_bit(ma->master, gth->output[old_port].master);
/* * if the port is active, program this setting, * implies that runtime PM is on
*/ if (gth->output[old_port].output->active)
gth_master_set(gth, ma->master, -1);
}
/* connect to the new output port, if any */ if (port >= 0) { /* check if there's a driver for this port */ if (!gth->output[port].output) {
count = -ENODEV; goto unlock;
}
set_bit(ma->master, gth->output[port].master);
/* if the port is active, program this setting, see above */ if (gth->output[port].output->active)
gth_master_set(gth, ma->master, port);
}
/** * intel_th_gth_stop() - stop tracing to an output device * @gth: GTH device * @output: output device's descriptor * @capture_done: set when no more traces will be captured * * This will stop tracing using force storeEn off signal and wait for the * pipelines to be empty for the corresponding output port.
*/ staticvoid intel_th_gth_stop(struct gth_device *gth, struct intel_th_output *output, bool capture_done)
{ struct intel_th_device *outdev =
container_of(output, struct intel_th_device, output); struct intel_th_driver *outdrv =
to_intel_th_driver(outdev->dev.driver); unsignedlong count;
u32 reg;
u32 scr2 = 0xfc | (capture_done ? 1 : 0);
/** * intel_th_gth_disable() - disable tracing to an output device * @thdev: GTH device * @output: output device's descriptor * * This will deconfigure all masters set to output to this device, * disable tracing using force storeEn off signal and wait for the * "pipeline empty" bit for corresponding output port.
*/ staticvoid intel_th_gth_disable(struct intel_th_device *thdev, struct intel_th_output *output)
{ struct gth_device *gth = dev_get_drvdata(&thdev->dev); int master;
u32 reg;
/* * Wait until the output port is in reset before we start * programming it.
*/ for (count = GTH_PLE_WAITLOOP_DEPTH;
count && !(gth_output_get(gth, output->port) & BIT(5)); count--)
cpu_relax();
}
/** * intel_th_gth_enable() - enable tracing to an output device * @thdev: GTH device * @output: output device's descriptor * * This will configure all masters set to output to this device and * enable tracing using force storeEn signal.
*/ staticvoid intel_th_gth_enable(struct intel_th_device *thdev, struct intel_th_output *output)
{ struct gth_device *gth = dev_get_drvdata(&thdev->dev); struct intel_th *th = to_intel_th(thdev); int master;
u32 scrpd;
/** * intel_th_gth_assign() - assign output device to a GTH output port * @thdev: GTH device * @othdev: output device * * This will match a given output device parameters against present * output ports on the GTH and fill out relevant bits in output device's * descriptor. * * Return: 0 on success, -errno on error.
*/ staticint intel_th_gth_assign(struct intel_th_device *thdev, struct intel_th_device *othdev)
{ struct gth_device *gth = dev_get_drvdata(&thdev->dev); int i, id;
if (thdev->host_mode) return -EBUSY;
if (othdev->type != INTEL_TH_OUTPUT) return -EINVAL;
for (i = 0, id = 0; i < TH_POSSIBLE_OUTPUTS; i++) { if (gth->output[i].port_type != othdev->output.type) continue;
if (othdev->id == -1 || othdev->id == id) goto found;
staticint
intel_th_gth_set_output(struct intel_th_device *thdev, unsignedint master)
{ struct gth_device *gth = dev_get_drvdata(&thdev->dev); int port = 0; /* FIXME: make default output configurable */
/* * everything above TH_CONFIGURABLE_MASTERS is controlled by the * same register
*/ if (master > TH_CONFIGURABLE_MASTERS)
master = TH_CONFIGURABLE_MASTERS;
/* * Host mode can be signalled via SW means or via SCRPD_DEBUGGER_IN_USE * bit. Either way, don't reset HW in this case, and don't export any * capture configuration attributes. Also, refuse to assign output * drivers to ports, see intel_th_gth_assign().
*/ if (thdev->host_mode) return 0;
ret = intel_th_gth_reset(gth); if (ret) { if (ret != -EBUSY) return ret;
thdev->host_mode = true;
return 0;
}
for (i = 0; i < TH_CONFIGURABLE_MASTERS + 1; i++)
gth->master[i] = -1;
for (i = 0; i < TH_POSSIBLE_OUTPUTS; i++) {
gth->output[i].gth = gth;
gth->output[i].index = i;
gth->output[i].port_type =
gth_output_parm_get(gth, i, TH_OUTPUT_PARM(port)); if (gth->output[i].port_type == GTH_NONE) continue;
ret = intel_th_output_enable(th, gth->output[i].port_type); /* -ENODEV is ok, we just won't have that device enumerated */ if (ret && ret != -ENODEV) return ret;
}
if (intel_th_output_attributes(gth) ||
intel_th_master_attributes(gth)) {
pr_warn("Can't initialize sysfs attributes\n");
if (gth->output_group.attrs)
sysfs_remove_group(>h->dev->kobj, >h->output_group); return -ENOMEM;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.