Skip to content

Commit

Permalink
drm/sti: rename files and functions
Browse files Browse the repository at this point in the history
replace all "sti_drm_" occurences by "sti_"

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
  • Loading branch information
Vincent Abriou authored and Benjamin Gaignard committed Aug 3, 2015
1 parent 871bcdf commit 9e1f05b
Show file tree
Hide file tree
Showing 16 changed files with 182 additions and 183 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/sti/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sticompositor-y := \
sti_vid.o \
sti_cursor.o \
sti_compositor.o \
sti_drm_crtc.o \
sti_drm_plane.o
sti_crtc.o \
sti_plane.o

stihdmi-y := sti_hdmi.o \
sti_hdmi_tx3g0c55phy.o \
Expand All @@ -23,4 +23,4 @@ obj-$(CONFIG_DRM_STI) = \
sticompositor.o \
sti_hqvdp.o \
stidvo.o \
sti_drm_drv.o
sti_drv.o
24 changes: 12 additions & 12 deletions drivers/gpu/drm/sti/sti_compositor.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include <drm/drmP.h>

#include "sti_compositor.h"
#include "sti_crtc.h"
#include "sti_cursor.h"
#include "sti_drm_crtc.h"
#include "sti_drm_drv.h"
#include "sti_drm_plane.h"
#include "sti_drv.h"
#include "sti_gdp.h"
#include "sti_plane.h"
#include "sti_vid.h"
#include "sti_vtg.h"

Expand Down Expand Up @@ -62,7 +62,7 @@ static int sti_compositor_bind(struct device *dev,
struct sti_compositor *compo = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
unsigned int i, mixer_id = 0, vid_id = 0, crtc_id = 0, plane_id = 0;
struct sti_drm_private *dev_priv = drm_dev->dev_private;
struct sti_private *dev_priv = drm_dev->dev_private;
struct drm_plane *cursor = NULL;
struct drm_plane *primary = NULL;
struct sti_compositor_subdev_descriptor *desc = compo->data.subdev_desc;
Expand Down Expand Up @@ -116,8 +116,8 @@ static int sti_compositor_bind(struct device *dev,
DRM_ERROR("Can't create CURSOR plane\n");
break;
}
cursor = sti_drm_plane_init(drm_dev, plane, 1,
DRM_PLANE_TYPE_CURSOR);
cursor = sti_plane_init(drm_dev, plane, 1,
DRM_PLANE_TYPE_CURSOR);
plane_id++;
break;
case STI_GPD_SUBDEV:
Expand All @@ -127,9 +127,9 @@ static int sti_compositor_bind(struct device *dev,
DRM_ERROR("Can't create GDP plane\n");
break;
}
primary = sti_drm_plane_init(drm_dev, plane,
(1 << mixer_id) - 1,
plane_type);
primary = sti_plane_init(drm_dev, plane,
(1 << mixer_id) - 1,
plane_type);
plane_id++;
break;
default:
Expand All @@ -139,8 +139,8 @@ static int sti_compositor_bind(struct device *dev,

/* The first planes are reserved for primary planes*/
if (crtc_id < mixer_id && primary) {
sti_drm_crtc_init(drm_dev, compo->mixer[crtc_id],
primary, cursor);
sti_crtc_init(drm_dev, compo->mixer[crtc_id],
primary, cursor);
crtc_id++;
cursor = NULL;
primary = NULL;
Expand Down Expand Up @@ -196,7 +196,7 @@ static int sti_compositor_probe(struct platform_device *pdev)
return -ENOMEM;
}
compo->dev = dev;
compo->vtg_vblank_nb.notifier_call = sti_drm_crtc_vblank_cb;
compo->vtg_vblank_nb.notifier_call = sti_crtc_vblank_cb;

/* populate data structure depending on compatibility */
BUG_ON(!of_match_node(compositor_of_match, np)->data);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sti/sti_compositor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <linux/clk.h>
#include <linux/kernel.h>

#include "sti_drm_plane.h"
#include "sti_mixer.h"
#include "sti_plane.h"

#define WAIT_NEXT_VSYNC_MS 50 /*ms*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
#include <drm/drm_plane_helper.h>

#include "sti_compositor.h"
#include "sti_drm_drv.h"
#include "sti_drm_crtc.h"
#include "sti_crtc.h"
#include "sti_drv.h"
#include "sti_vtg.h"

static void sti_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
static void sti_crtc_dpms(struct drm_crtc *crtc, int mode)
{
DRM_DEBUG_KMS("\n");
}

static void sti_drm_crtc_prepare(struct drm_crtc *crtc)
static void sti_crtc_prepare(struct drm_crtc *crtc)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);
struct device *dev = mixer->dev;
Expand All @@ -44,7 +44,7 @@ static void sti_drm_crtc_prepare(struct drm_crtc *crtc)
sti_mixer_clear_all_planes(mixer);
}

static void sti_drm_crtc_commit(struct drm_crtc *crtc)
static void sti_crtc_commit(struct drm_crtc *crtc)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);
struct device *dev = mixer->dev;
Expand All @@ -68,16 +68,16 @@ static void sti_drm_crtc_commit(struct drm_crtc *crtc)
drm_crtc_vblank_on(crtc);
}

static bool sti_drm_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
static bool sti_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
/* accept the provided drm_display_mode, do not fix it up */
return true;
}

static int
sti_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode)
sti_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);
struct device *dev = mixer->dev;
Expand Down Expand Up @@ -127,7 +127,7 @@ sti_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode)
return res;
}

static void sti_drm_crtc_disable(struct drm_crtc *crtc)
static void sti_crtc_disable(struct drm_crtc *crtc)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);
struct device *dev = mixer->dev;
Expand Down Expand Up @@ -156,13 +156,13 @@ static void sti_drm_crtc_disable(struct drm_crtc *crtc)
}

static void
sti_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
sti_crtc_mode_set_nofb(struct drm_crtc *crtc)
{
sti_drm_crtc_prepare(crtc);
sti_drm_crtc_mode_set(crtc, &crtc->state->adjusted_mode);
sti_crtc_prepare(crtc);
sti_crtc_mode_set(crtc, &crtc->state->adjusted_mode);
}

static void sti_drm_crtc_atomic_begin(struct drm_crtc *crtc)
static void sti_crtc_atomic_begin(struct drm_crtc *crtc)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);

Expand All @@ -176,46 +176,46 @@ static void sti_drm_crtc_atomic_begin(struct drm_crtc *crtc)
}
}

static void sti_drm_crtc_atomic_flush(struct drm_crtc *crtc)
static void sti_crtc_atomic_flush(struct drm_crtc *crtc)
{
}

static struct drm_crtc_helper_funcs sti_crtc_helper_funcs = {
.dpms = sti_drm_crtc_dpms,
.prepare = sti_drm_crtc_prepare,
.commit = sti_drm_crtc_commit,
.mode_fixup = sti_drm_crtc_mode_fixup,
.dpms = sti_crtc_dpms,
.prepare = sti_crtc_prepare,
.commit = sti_crtc_commit,
.mode_fixup = sti_crtc_mode_fixup,
.mode_set = drm_helper_crtc_mode_set,
.mode_set_nofb = sti_drm_crtc_mode_set_nofb,
.mode_set_nofb = sti_crtc_mode_set_nofb,
.mode_set_base = drm_helper_crtc_mode_set_base,
.disable = sti_drm_crtc_disable,
.atomic_begin = sti_drm_crtc_atomic_begin,
.atomic_flush = sti_drm_crtc_atomic_flush,
.disable = sti_crtc_disable,
.atomic_begin = sti_crtc_atomic_begin,
.atomic_flush = sti_crtc_atomic_flush,
};

static void sti_drm_crtc_destroy(struct drm_crtc *crtc)
static void sti_crtc_destroy(struct drm_crtc *crtc)
{
DRM_DEBUG_KMS("\n");
drm_crtc_cleanup(crtc);
}

static int sti_drm_crtc_set_property(struct drm_crtc *crtc,
struct drm_property *property,
uint64_t val)
static int sti_crtc_set_property(struct drm_crtc *crtc,
struct drm_property *property,
uint64_t val)
{
DRM_DEBUG_KMS("\n");
return 0;
}

int sti_drm_crtc_vblank_cb(struct notifier_block *nb,
unsigned long event, void *data)
int sti_crtc_vblank_cb(struct notifier_block *nb,
unsigned long event, void *data)
{
struct drm_device *drm_dev;
struct sti_compositor *compo =
container_of(nb, struct sti_compositor, vtg_vblank_nb);
int *crtc = data;
unsigned long flags;
struct sti_drm_private *priv;
struct sti_private *priv;

drm_dev = compo->mixer[*crtc]->drm_crtc.dev;
priv = drm_dev->dev_private;
Expand All @@ -231,7 +231,7 @@ int sti_drm_crtc_vblank_cb(struct notifier_block *nb,
spin_lock_irqsave(&drm_dev->event_lock, flags);
if (compo->mixer[*crtc]->pending_event) {
drm_send_vblank_event(drm_dev, -1,
compo->mixer[*crtc]->pending_event);
compo->mixer[*crtc]->pending_event);
drm_vblank_put(drm_dev, *crtc);
compo->mixer[*crtc]->pending_event = NULL;
}
Expand All @@ -240,9 +240,9 @@ int sti_drm_crtc_vblank_cb(struct notifier_block *nb,
return 0;
}

int sti_drm_crtc_enable_vblank(struct drm_device *dev, int crtc)
int sti_crtc_enable_vblank(struct drm_device *dev, int crtc)
{
struct sti_drm_private *dev_priv = dev->dev_private;
struct sti_private *dev_priv = dev->dev_private;
struct sti_compositor *compo = dev_priv->compo;
struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb;

Expand All @@ -257,11 +257,11 @@ int sti_drm_crtc_enable_vblank(struct drm_device *dev, int crtc)

return 0;
}
EXPORT_SYMBOL(sti_drm_crtc_enable_vblank);
EXPORT_SYMBOL(sti_crtc_enable_vblank);

void sti_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
void sti_crtc_disable_vblank(struct drm_device *dev, int crtc)
{
struct sti_drm_private *priv = dev->dev_private;
struct sti_private *priv = dev->dev_private;
struct sti_compositor *compo = priv->compo;
struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb;

Expand All @@ -277,19 +277,19 @@ void sti_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
compo->mixer[crtc]->pending_event = NULL;
}
}
EXPORT_SYMBOL(sti_drm_crtc_disable_vblank);
EXPORT_SYMBOL(sti_crtc_disable_vblank);

static struct drm_crtc_funcs sti_crtc_funcs = {
.set_config = drm_atomic_helper_set_config,
.page_flip = drm_atomic_helper_page_flip,
.destroy = sti_drm_crtc_destroy,
.set_property = sti_drm_crtc_set_property,
.destroy = sti_crtc_destroy,
.set_property = sti_crtc_set_property,
.reset = drm_atomic_helper_crtc_reset,
.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
};

bool sti_drm_crtc_is_main(struct drm_crtc *crtc)
bool sti_crtc_is_main(struct drm_crtc *crtc)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);

Expand All @@ -298,16 +298,16 @@ bool sti_drm_crtc_is_main(struct drm_crtc *crtc)

return false;
}
EXPORT_SYMBOL(sti_drm_crtc_is_main);
EXPORT_SYMBOL(sti_crtc_is_main);

int sti_drm_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer,
struct drm_plane *primary, struct drm_plane *cursor)
int sti_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer,
struct drm_plane *primary, struct drm_plane *cursor)
{
struct drm_crtc *crtc = &mixer->drm_crtc;
int res;

res = drm_crtc_init_with_planes(drm_dev, crtc, primary, cursor,
&sti_crtc_funcs);
&sti_crtc_funcs);
if (res) {
DRM_ERROR("Can't initialze CRTC\n");
return -EINVAL;
Expand Down
22 changes: 22 additions & 0 deletions drivers/gpu/drm/sti/sti_crtc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (C) STMicroelectronics SA 2014
* Author: Benjamin Gaignard <benjamin.gaignard@st.com> for STMicroelectronics.
* License terms: GNU General Public License (GPL), version 2
*/

#ifndef _STI_CRTC_H_
#define _STI_CRTC_H_

#include <drm/drmP.h>

struct sti_mixer;

int sti_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer,
struct drm_plane *primary, struct drm_plane *cursor);
int sti_crtc_enable_vblank(struct drm_device *dev, int crtc);
void sti_crtc_disable_vblank(struct drm_device *dev, int crtc);
int sti_crtc_vblank_cb(struct notifier_block *nb,
unsigned long event, void *data);
bool sti_crtc_is_main(struct drm_crtc *drm_crtc);

#endif
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sti/sti_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <drm/drmP.h>

#include "sti_cursor.h"
#include "sti_drm_plane.h"
#include "sti_plane.h"
#include "sti_vtg.h"

/* Registers */
Expand Down
22 changes: 0 additions & 22 deletions drivers/gpu/drm/sti/sti_drm_crtc.h

This file was deleted.

Loading

0 comments on commit 9e1f05b

Please sign in to comment.