static void tegra_overlay_put_locked(struct overlay_client *client, int idx) { struct tegra_overlay_flip_args flip_args; struct tegra_overlay_info *dev = client->dev; if (idx < 0 || idx > dev->dc->n_windows) return; if (dev->overlays[idx].owner != client) return; dev_dbg(&client->dev->ndev->dev, "%s(): idx=%d pid=%d comm=%s\n", __func__, idx, client->task->pid, client->task->comm); dev->overlays[idx].owner = NULL; flip_args.win[0].index = idx; flip_args.win[0].buff_id = 0; flip_args.win[1].index = -1; flip_args.win[2].index = -1; flip_args.flags = 0; tegra_overlay_flip(dev, &flip_args, NULL); if (dev->dc->mode.pclk != 0) tegra_overlay_set_emc_freq(dev); }
/* Overlay functions */ static bool tegra_overlay_get(struct overlay_client *client, int idx) { struct tegra_overlay_info *dev = client->dev; bool ret = false; if (idx < 0 || idx > dev->dc->n_windows) return ret; mutex_lock(&dev->overlays_lock); if (dev->overlays[idx].owner == NULL) { dev->overlays[idx].owner = client; ret = true; if (dev->dc->mode.pclk != 0) tegra_overlay_set_emc_freq(dev); } mutex_unlock(&dev->overlays_lock); return ret; }
static void tegra_overlay_put_locked(struct overlay_client *client, int idx) { struct tegra_overlay_flip_args flip_args; struct tegra_overlay_info *dev = client->dev; if (idx < 0 || idx > dev->dc->n_windows) return; if (dev->overlays[idx].owner != client) return; dev->overlays[idx].owner = NULL; flip_args.win[0].index = idx; flip_args.win[0].buff_id = 0; flip_args.win[1].index = -1; flip_args.win[2].index = -1; tegra_overlay_flip(dev, &flip_args, NULL); if (dev->dc->mode.pclk != 0) tegra_overlay_set_emc_freq(dev); }
/* Overlay functions */ static bool tegra_overlay_get(struct overlay_client *client, int idx) { struct tegra_overlay_info *dev = client->dev; bool ret = false; if (idx < 0 || idx > dev->dc->n_windows) return ret; mutex_lock(&dev->overlays_lock); if (dev->overlays[idx].owner == NULL) { dev->overlays[idx].owner = client; ret = true; if (dev->dc->mode.pclk != 0) tegra_overlay_set_emc_freq(dev); dev_dbg(&client->dev->ndev->dev, "%s(): idx=%d pid=%d comm=%s\n", __func__, idx, client->task->pid, client->task->comm); } mutex_unlock(&dev->overlays_lock); return ret; }