Skip to content

Commit 357eebc

Browse files
committed
Remove old gfx/screen.h video API
Only use the new adapter->monitor->buffer API
1 parent 84de113 commit 357eebc

File tree

9 files changed

+9
-802
lines changed

9 files changed

+9
-802
lines changed

kos/include/libvideo/gfx/anim.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,24 @@ struct video_anim_ops {
8383
* >> struct timeval frame_start, frame_end;
8484
* >> struct timeval tv_delay, tv_spent, showfor;
8585
* >> struct timespec ts_delay;
86-
* >> REF struct video_screen *screen;
86+
* >> REF struct video_buffer *screen;
8787
* >> REF struct video_anim *anim;
8888
* >> struct video_anim_frame *data;
8989
* >>
90-
* >> screen = screen_buffer_create(NULL);
90+
* >> screen = ...;
9191
* >> anim = video_anim_open("/var/anim.gif");
9292
* >> data = (struct video_anim_frame *)malloca(video_anim_sizeof_frame(anim));
9393
* >>
9494
* >> video_anim_firstframe(anim, data);
95-
* >> video_buffer_getgfx((struct video_buffer *)screen, &screen_gfx, GFX_BLENDMODE_OVERRIDE);
95+
* >> video_buffer_getgfx(screen, &screen_gfx, GFX_BLENDMODE_OVERRIDE);
9696
* >> gettimeofday(&frame_start, NULL);
9797
* >> for (;;) {
9898
* >>
9999
* >> // Display current frame on-screen (here: stretched)
100100
* >> video_buffer_getgfx(data->vaf_frame, &frame_gfx, GFX_BLENDMODE_OVERRIDE);
101101
* >> video_gfx_stretch(&screen_gfx, 0, 0, VIDEO_DIM_MAX, VIDEO_DIM_MAX,
102102
* >> &frame_gfx, 0, 0, VIDEO_DIM_MAX, VIDEO_DIM_MAX);
103-
* >> struct video_crect update_rect = VIDEO_CRECT_INIT_FULL;
104-
* >> screen_buffer_updaterect(screen, &update_rect);
103+
* >> video_display_updaterect(...);
105104
* >>
106105
* >> // Load next frame as part of render delay
107106
* >> showfor = data->vaf_showfor;

kos/include/libvideo/gfx/display.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ struct video_display_ops {
6363
(LIBVIDEO_GFX_CC *vdo_getbuffer)(struct video_display *__restrict __self);
6464

6565
/* TODO: Operator for changing/updating the palette used by `vdo_getbuffer' */
66+
/* TODO: Operator to test if display is in V-blank right now (non-monitor-buffers always return "true" here)
67+
* Using this operator, code can then wait for V-blank to happen in order to prevent screen-tearing. */
6668

6769
/* Indicate that the contents of a given physical rect have changed.
6870
* Chipset drivers might need this to propagate changes to actually

kos/include/libvideo/gfx/screen.h

Lines changed: 0 additions & 161 deletions
This file was deleted.

kos/src/_verify/include-everything.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,7 @@ incdir("");
12131213
#include <libvideo/gfx/api.h>
12141214
#include <libvideo/gfx/blend.h>
12151215
#include <libvideo/gfx/blendcolors.h>
1216+
#include <libvideo/gfx/buffer/rambuffer.h>
12161217
#include <libvideo/gfx/buffer.h>
12171218
#include <libvideo/gfx/codec/codec-extra.h>
12181219
#include <libvideo/gfx/codec/codec.h>
@@ -1223,7 +1224,6 @@ incdir("");
12231224
#include <libvideo/gfx/fonts/tlft.h>
12241225
#include <libvideo/gfx/gfx-flags.h>
12251226
#include <libvideo/gfx/gfx.h>
1226-
#include <libvideo/gfx/screen.h>
12271227
#include <libvideo/gfx/surface-defs.h>
12281228
#include <libvideo/gfx/surface.h>
12291229
#include <libvideo/rect.h>

kos/src/apps/gfx/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include <libvideo/gfx/buffer.h>
4949
#include <libvideo/gfx/font.h>
5050
#include <libvideo/gfx/gfx.h>
51-
#include <libvideo/gfx/screen.h>
5251
#include <libvideo/gfx/surface.h>
5352
#include <libvideo/rect.h>
5453

kos/src/libvideo/driver/adapter/svga.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ svga_setmode(struct video_monitor *__restrict self,
541541
if (old_modeinfo)
542542
video_monitor_mode_fini(&me->sva_mode);
543543
memcpy(&me->sva_mode, mode, sizeof(struct video_monitor_mode));
544-
axref_clear(&me->sva_buffer);
544+
axref_clear(&me->sva_buffer); /* Discard old display buffer to force creation of a new one */
545545
svga_adapter_cs_release(me);
546546
free(old_modeinfo);
547547
return 0;

kos/src/libvideo/driver/adapter/svga.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct svga_adapter: video_adapter {
7575
void *sva_libsvgadrv; /* [1..1][const] Handle for libsvgadrv */
7676
struct svga_chipset_driver const *sva_drv; /* [1..1][const] SVGA driver */
7777
#define svga_adapter_modeset(self) ((self)->sva_modeinfo != NULL)
78-
struct svga_modeinfo *sva_modeinfo; /* [0..1][lock(sva_cslock)] Descriptor for currently active video mode */
78+
struct svga_modeinfo *sva_modeinfo; /* [0..1][lock(sva_cslock)] Descriptor for currently active video mode ("NULL" means that no mode has been set, yet) */
7979
struct video_monitor_mode sva_mode; /* [valid_if(sva_modeinfo != NULL)][lock(sva_cslock)] Currently active video mode */
8080
struct svga_buffer_axref sva_buffer; /* [0..1][lock(READ(ATOMIC), WRITE(ATOMIC && sva_cslock))] Display buffer (or "NULL" if not allocated or display mode was just set) */
8181
struct shared_lock sva_cslock; /* Lock for interfacing with `sva_cs' */

0 commit comments

Comments
 (0)