media: bttv: remove tvnorm field from bttv_buffer
authorDeborah Brouwer <deborah.brouwer@collabora.com>
Sat, 15 Jul 2023 02:16:04 +0000 (19:16 -0700)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 14 Aug 2023 18:27:59 +0000 (20:27 +0200)
Instead of storing the tvnorm in each bttv buffer separately, just use the
global bttv tvnorm because the tvnorm does not change per buffer.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/pci/bt8xx/bttv-driver.c
drivers/media/pci/bt8xx/bttv-risc.c
drivers/media/pci/bt8xx/bttvp.h

index 0032e143611195006fadbedda16b81485456267d..f32050849691af0e3a01055e912a58df73c2e2a0 100644 (file)
@@ -1553,7 +1553,7 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
        /* alloc + fill struct bttv_buffer (if changed) */
        if (buf->vb.width != width || buf->vb.height != height ||
            buf->vb.field != field ||
-           buf->tvnorm != norm || btv->fmt != fmt ||
+           btv->tvnorm != norm || btv->fmt != fmt ||
            buf->crop.top != c.rect.top ||
            buf->crop.left != c.rect.left ||
            buf->crop.width != c.rect.width ||
@@ -1561,7 +1561,7 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
                buf->vb.width  = width;
                buf->vb.height = height;
                buf->vb.field  = field;
-               buf->tvnorm    = norm;
+               btv->tvnorm    = norm;
                buf->crop      = c.rect;
                redo_dma_risc = 1;
        }
index 67ea7ed42623922ea74c5c474a67c13030b8de57..0a296dc1a7a56d47abf3d0847e0d85804a0633e6 100644 (file)
@@ -606,7 +606,7 @@ bttv_buffer_activate_video(struct bttv *btv,
 int
 bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
 {
-       const struct bttv_tvnorm *tvnorm = bttv_tvnorms + buf->tvnorm;
+       const struct bttv_tvnorm *tvnorm = bttv_tvnorms + btv->tvnorm;
        struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
 
        dprintk("%d: buffer field: %s  format: 0x%08x  size: %dx%d\n",
index 402fe1f1846ef60272fe7a1aadbb246bb14b0389..bbb5fc060fadcab26af445a3ed4e7406626b29d8 100644 (file)
@@ -145,7 +145,6 @@ struct bttv_buffer {
        struct videobuf_buffer     vb;
 
        /* bttv specific */
-       unsigned int               tvnorm;
        int                        btformat;
        int                        btswap;
        struct bttv_geometry       geo;