@@ -92,7 +92,6 @@ int scene_new(struct expo *exp, const char *name, uint id, struct scene **scnp)
free(scn);
return log_msg_ret("buf", -ENOMEM);
}
- abuf_init(&scn->entry_save);
INIT_LIST_HEAD(&scn->obj_head);
scn->id = resolve_id(exp, id);
@@ -122,7 +121,6 @@ void scene_destroy(struct scene *scn)
list_for_each_entry_safe(obj, next, &scn->obj_head, sibling)
scene_obj_destroy(obj);
- abuf_uninit(&scn->entry_save);
abuf_uninit(&scn->buf);
free(scn->name);
free(scn);
@@ -147,9 +147,6 @@ int scene_txtin_open(struct scene *scn, struct scene_obj *obj,
cls->putch = scene_txtin_putch;
cls->priv = scn;
cli_cread_add_initial(cls);
- ret = vidconsole_entry_save(cons, &scn->entry_save);
- if (ret)
- return log_msg_ret("sav", ret);
/* make sure the cursor is visible */
vidconsole_readline_start(cons, ctx, true);
@@ -204,20 +201,10 @@ int scene_txtin_send_key(struct scene_obj *obj, struct scene_txtin *tin,
event->select.id = obj->id;
key = '\n';
fallthrough;
- default: {
- struct udevice *cons = scn->expo->cons;
- int ret;
-
- ret = vidconsole_entry_restore(cons, &scn->entry_save);
- if (ret)
- return log_msg_ret("sav", ret);
- ret = cread_line_process_ch(cls, key);
- ret = vidconsole_entry_save(cons, &scn->entry_save);
- if (ret)
- return log_msg_ret("sav", ret);
+ default:
+ cread_line_process_ch(cls, key);
break;
}
- }
return 0;
}
@@ -133,36 +133,6 @@ static __maybe_unused int console_get_cursor_info(struct udevice *dev,
return 0;
}
-static __maybe_unused int normal_entry_save(struct udevice *dev,
- struct abuf *buf)
-{
- struct console_ctx *ctx = vidconsole_ctx(dev);
- const uint size = sizeof(*ctx);
-
- if (xpl_phase() <= PHASE_SPL)
- return -ENOSYS;
-
- if (!abuf_realloc(buf, size))
- return log_msg_ret("sav", -ENOMEM);
-
- memcpy(abuf_data(buf), ctx, size);
-
- return 0;
-}
-
-static __maybe_unused int normal_entry_restore(struct udevice *dev,
- struct abuf *buf)
-{
- struct console_ctx *ctx = vidconsole_ctx(dev);
-
- if (xpl_phase() <= PHASE_SPL)
- return -ENOSYS;
-
- memcpy(ctx, abuf_data(buf), sizeof(*ctx));
-
- return 0;
-}
-
static int console_putc_xy(struct udevice *dev, void *vctx, uint x_frac,
uint y, int cp)
{
@@ -179,8 +149,6 @@ struct vidconsole_ops console_ops = {
.ctx_new = console_simple_ctx_new,
#ifdef CONFIG_CURSOR
.get_cursor_info = console_get_cursor_info,
- .entry_save = normal_entry_save,
- .entry_restore = normal_entry_restore,
#endif
};
@@ -1156,34 +1156,6 @@ static int truetype_ctx_new(struct udevice *dev, void *vctx)
return 0;
}
-static int truetype_entry_save(struct udevice *dev, struct abuf *buf)
-{
- struct console_tt_ctx *ctx = vidconsole_ctx(dev);
- const uint size = sizeof(*ctx);
-
- if (xpl_phase() <= PHASE_SPL)
- return -ENOSYS;
-
- if (!abuf_realloc(buf, size))
- return log_msg_ret("sav", -ENOMEM);
-
- memcpy(abuf_data(buf), ctx, size);
-
- return 0;
-}
-
-static int truetype_entry_restore(struct udevice *dev, struct abuf *buf)
-{
- struct console_tt_ctx *ctx = vidconsole_ctx(dev);
-
- if (xpl_phase() <= PHASE_SPL)
- return -ENOSYS;
-
- memcpy(ctx, abuf_data(buf), sizeof(*ctx));
-
- return 0;
-}
-
static int truetype_get_cursor_info(struct udevice *dev, void *vctx)
{
struct console_tt_ctx *ctx = vctx;
@@ -1196,9 +1168,7 @@ static int truetype_get_cursor_info(struct udevice *dev, void *vctx)
return -ENOSYS;
/*
- * figure out where to place the cursor. This driver ignores the
- * passed-in values, since an entry_restore() must have been done before
- * calling this function.
+ * Figure out where to place the cursor.
*
* A current quirk is that the cursor is always at xcur_frac, since we
* output characters directly to the console as they are typed by the
@@ -1315,8 +1285,6 @@ struct vidconsole_ops console_truetype_ops = {
.measure = truetype_measure,
.nominal = truetype_nominal,
.ctx_new = truetype_ctx_new,
- .entry_save = truetype_entry_save,
- .entry_restore = truetype_entry_restore,
.get_cursor_info = truetype_get_cursor_info,
.mark_start = truetype_mark_start,
};
@@ -801,37 +801,6 @@ int vidconsole_ctx_dispose(struct udevice *dev, void *vctx)
return 0;
}
-int vidconsole_entry_save(struct udevice *dev, struct abuf *buf)
-{
- struct vidconsole_ops *ops = vidconsole_get_ops(dev);
- int ret;
-
- if (ops->entry_save) {
- ret = ops->entry_save(dev, buf);
- if (ret != -ENOSYS)
- return ret;
- }
-
- /* no data so make sure the buffer is empty */
- abuf_realloc(buf, 0);
-
- return 0;
-}
-
-int vidconsole_entry_restore(struct udevice *dev, struct abuf *buf)
-{
- struct vidconsole_ops *ops = vidconsole_get_ops(dev);
- int ret;
-
- if (ops->entry_restore) {
- ret = ops->entry_restore(dev, buf);
- if (ret != -ENOSYS)
- return ret;
- }
-
- return 0;
-}
-
#ifdef CONFIG_CURSOR
int vidconsole_show_cursor(struct udevice *dev, void *vctx)
{
@@ -208,7 +208,6 @@ struct expo_string {
* @highlight_id: ID of highlighted object, if any
* @cls: cread state to use for input
* @buf: Buffer for input
- * @entry_save: Buffer to hold vidconsole text-entry information
* @sibling: Node to link this scene to its siblings
* @obj_head: List of objects in the scene
*/
@@ -221,7 +220,6 @@ struct scene {
uint highlight_id;
struct cli_line_state cls;
struct abuf buf;
- struct abuf entry_save;
struct list_head sibling;
struct list_head obj_head;
};
@@ -405,30 +405,6 @@ struct vidconsole_ops {
*/
int (*ctx_dispose)(struct udevice *dev, void *ctx);
- /**
- * entry_save() - Save any text-entry information for later use
- *
- * Saves text-entry context such as a list of positions for each
- * character in the string.
- *
- * @dev: Console device to use
- * @buf: Buffer to hold saved data
- * Return: 0 if OK, -ENOMEM if out of memory
- */
- int (*entry_save)(struct udevice *dev, struct abuf *buf);
-
- /**
- * entry_restore() - Restore text-entry information for current use
- *
- * Restores text-entry context such as a list of positions for each
- * character in the string.
- *
- * @dev: Console device to use
- * @buf: Buffer containing data to restore
- * Return: 0 if OK, -ve on error
- */
- int (*entry_restore)(struct udevice *dev, struct abuf *buf);
-
/**
* get_cursor_info() - Get cursor position info
*
@@ -558,30 +534,6 @@ int vidconsole_ctx_new(struct udevice *dev, void **ctxp);
*/
int vidconsole_ctx_dispose(struct udevice *dev, void *ctx);
-/**
- * vidconsole_entry_save() - Save any text-entry information for later use
- *
- * Saves text-entry context such as a list of positions for each
- * character in the string.
- *
- * @dev: Console device to use
- * @buf: Buffer to hold saved data
- * Return: 0 if OK, -ENOMEM if out of memory
- */
-int vidconsole_entry_save(struct udevice *dev, struct abuf *buf);
-
-/**
- * entry_restore() - Restore text-entry information for current use
- *
- * Restores text-entry context such as a list of positions for each
- * character in the string.
- *
- * @dev: Console device to use
- * @buf: Buffer containing data to restore
- * Return: 0 if OK, -ve on error
- */
-int vidconsole_entry_restore(struct udevice *dev, struct abuf *buf);
-
#ifdef CONFIG_CURSOR
/**
* vidconsole_show_cursor() - Show the cursor
@@ -1516,70 +1516,3 @@ static int dm_test_video_context_alloc(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_video_context_alloc, UTF_SCAN_PDATA | UTF_SCAN_FDT);
-
-/* Test vidconsole entry save/restore */
-static int check_entry_save(struct unit_test_state *uts, struct udevice *con)
-{
- struct vidconsole_priv *priv;
- struct vidconsole_ctx *ctx;
- int xcur_frac, ycur;
- struct abuf buf;
-
- priv = dev_get_uclass_priv(con);
- ctx = priv->ctx;
-
- /* Move cursor to a known position */
- vidconsole_position_cursor(con, 5, 3);
- xcur_frac = ctx->xcur_frac;
- ycur = ctx->ycur;
-
- /* Save the state */
- abuf_init(&buf);
- ut_assertok(vidconsole_entry_save(con, &buf));
-
- /* Move cursor to a different position */
- vidconsole_position_cursor(con, 10, 7);
- ut_assert(ctx->xcur_frac != xcur_frac || ctx->ycur != ycur);
-
- /* Restore the state */
- ut_assertok(vidconsole_entry_restore(con, &buf));
-
- /* Verify cursor is back at saved position */
- ut_asserteq(xcur_frac, ctx->xcur_frac);
- ut_asserteq(ycur, ctx->ycur);
-
- abuf_uninit(&buf);
-
- return 0;
-}
-
-/* Test entry save/restore with bitmap font */
-static int dm_test_video_entry_save(struct unit_test_state *uts)
-{
- struct udevice *dev, *con;
-
- ut_assertok(select_vidconsole(uts, "vidconsole0"));
- ut_assertok(video_get_nologo(uts, &dev));
- ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
- ut_assertok(vidconsole_select_font(con, NULL, "8x16", 0));
-
- ut_assertok(check_entry_save(uts, con));
-
- return 0;
-}
-DM_TEST(dm_test_video_entry_save, UTF_SCAN_PDATA | UTF_SCAN_FDT);
-
-/* Test entry save/restore with truetype font */
-static int dm_test_video_entry_save_tt(struct unit_test_state *uts)
-{
- struct udevice *dev, *con;
-
- ut_assertok(video_get_nologo(uts, &dev));
- ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
- ut_assertok(vidconsole_select_font(con, NULL, NULL, 30));
-
- ut_assertok(check_entry_save(uts, con));
-
- return 0;
-}
-DM_TEST(dm_test_video_entry_save_tt, UTF_SCAN_PDATA | UTF_SCAN_FDT);